Top Down Movement Relative to World Axis

Tenzho

New member
Basically what I want to achieve is for my character to move facing the same direction regardless of the camera's rotation using Top Down View and Movement.

I tried following the documentation and disable Relative Camera Movement

But now whenever I press UP or DOWN my character moves forward, and whenever I press LEFT or RIGHT it moves backward. And when I rotate my camera using the forward axis, my character is still moving relative to where the camera is facing.

Any solution to this?
 
Have you tested this in the demo scene? The top-down movement area in the demo can work both ways depending on whether Relative Camera Movement is enabled. Try comparing your camera and character to the demo's.
 
Hi, I have tested with the demo top-down movement area. If I disable only Relative Camera Movement, Nolan is moving based on which direction he is facing. I wanted my character to look at the movement direction and based on the world axis instead of the character axis.

I tried to make the following changes to Nolan's Movement Type settings and still get the weird movement as described above.
Disable Relative Camera Movement
Enable Look in Move Direction
Disable the aim ability


I'm making an isometric style game similar to the movement of Harvest Moon: Back To Nature. The character should be moving at a slight angle when you move forward instead of just straight up.

I hope that makes sense.
 
Yes I see what you mean now! I'll double check with Justin, but I think I found the source of the bug. In MovementTypes/TopDown.cs, in UseIndependentLook, you'll need to add return true; to the if statement, so that it looks like this:

C#:
        public override bool UseIndependentLook(bool characterLookDirection)
        {
            if (m_LookInMoveDirection || base.UseIndependentLook(characterLookDirection)) {
                return true; // <-- new line
            }
            return !characterLookDirection || m_PlayerInput.IsControllerConnected();
        }

I'll let Justin know to add this to the next update, but once you've added that you should be able to just use Look In Move Direction as expected. (You may then want to adjust the look at weights in the Character IK.)
 
Yes I see what you mean now! I'll double check with Justin, but I think I found the source of the bug. In MovementTypes/TopDown.cs, in UseIndependentLook, you'll need to add return true; to the if statement, so that it looks like this:

C#:
        public override bool UseIndependentLook(bool characterLookDirection)
        {
            if (m_LookInMoveDirection || base.UseIndependentLook(characterLookDirection)) {
                return true; // <-- new line
            }
            return !characterLookDirection || m_PlayerInput.IsControllerConnected();
        }

I'll let Justin know to add this to the next update, but once you've added that you should be able to just use Look In Move Direction as expected. (You may then want to adjust the look at weights in the Character IK.)
I tried inserting the new line as indicated in the TopDown.cs script, but not sure what that does. My character is still walking strangely. Tried increasing / decreasing with the Character IK look weights too, but no avail.
 
I got it working in the demo scene by adding that line and enabling Look In Move Direction. I kept Relative Camera Movement enabled too. Then you can also reduce the Look At Body/Head/Eyes weights to 0.
 
Top