Implementing vertical arm movement in Top-Down Movement

Kutlu

New member
Hi Opsive!

I was gathering references for the game I am working on, and I ran across this game, which has vertical arm movement in its Top-Down perspective. I was wondering if you had any thoughts on how to achieve a similar control scheme in UCC.

Don't get me wrong, reading and studying the code is a joy, because it's clearly written and well factored. I just wanted to get your input on a possible route of implementation. I shared a gif of what I'm referring to under this text.

If you were to try and add something like this in UCC Top-Down Movement, where would you start? What scripts would you look into modifying? etc...

Thank you for making this tool available.

Kutlu

hellsign.gif
 
A lot of that is already implemented in the top down view type. If you enable Vertical Look Direction on the Top Down the character will look on the relative y plane as well. You can then make sure your IK component has a large weight set for the look at value and the character will turn to it.
 
Wow, that's good to hear. There's so much in this asset that isn't even advertised! If I may ask, though, where can I enable this option? I had already combed through all the scripts attached to the character before asking this question (and did so again after your message), but I couldn't find the option.
 
Check the ViewType within the CameraController component, pretty sure its there.
Thanks FastSkillTeam, I found the script. There's another problem, however. Namely, it says that the VerticalLookDirection is limited to above head height. This is unsuitable for my goal. Could someone give me an idea as to how to circumvent this problem? Here is the method:



/// <summary>
/// Returns the direction that the character is looking.
/// As topdown aiming relies on raycasting planes the plane position must match the IK position. Meaning the Movement Type is requesting the plane
/// at the head's position (to match CharacterIK and prevent rotation glitches with the mouse and IK that occur because of angle rays to parallel offset planes).
/// As a result the VerticalLookDirection is limited to above head height. Also, to cover all angles, the Anchor offset should be above head height.
/// </summary>
/// <param name="lookPosition">The position that the character is looking from.</param>
/// <param name="characterLookDirection">Is the character look direction being retrieved?</param>
/// <param name="layerMask">The LayerMask value of the objects that the look direction can hit.</param>
/// <param name="includeRecoil">Should recoil be included in the look direction?</param>
/// <param name="includeMovementSpread">Should the movement spread be included in the look direction?</param>
/// <returns>The direction that the character is looking.</returns>

public override Vector3 LookDirection(Vector3 lookPosition, bool characterLookDirection, int layerMask, bool includeRecoil, bool includeMovementSpread)
 
Last edited by a moderator:
I've removed the code since this is a public forum and you don't have to have a license to v2 to read it.

This is limited within the m_HitPlane.RayCast block. From my tests with IK enabled it did not give good looking results so the y direction is limited.
 
I've removed the code since this is a public forum and you don't have to have a license to v2 to read it.
I just seen this now in my email notification was about to suggest not to post scripts from a paid asset on a public forum...

@Kutlu
I made a few mods in a test after seeing this original post for some fun.
One was to make my own cursor script, that made the cursor invisible (by setting its texture) yet leaving it enabled... A trick used in UFPSv1
IK needs to be set as mentioned.
Offset can actually be modified to work below head limit super easy, that easy I forget how I did it, no code involved anyway...
The only thing I have not figured out yet, which I just haven't had the time to get back just yet, is that when I do that left mouse button doesn't work, so no firing yet, right mouse works fine so it is something simple, but probably needs codebase edits.
I am working on a demo scene that implements this for my asset for the VehicleWeaponShooters.
 
Sorry Justin. I wasn't aware of the implications of posting the method to the forum. I assumed that the forum wasn't public, cause I'm new to this.


I could really use a bit of detail regarding how it is limited within the m_HitPlane.RayCast block. I don't have the full picture of the codebase yet.
 
It has been awhile since I stepped through that code but by looking at it the hitplane is raycasted against and that will always be at a set level. Notice the y position is set to the hitpoint. For this situation I recommend using Debug.DrawRay to visualize what the raycasts are doing and that should give you a better idea of the logic.
 
Top