Back to Running in place

Well after all the code changes to movement. I’m back to running in place. The code all looks good. I did a Debug.Log around the Move() and got what seemed to be valid numbers. I commented out the Move() and put the old code back in and this allowed me to move the character around but it was floating in the air. I found that controller.isGrounded is returning false. I’m at a loss here. Any help would be appreciated.

Hey @radhat . Please post the code from PlayerFreeLookState , ForceReceiver , PlayerBaseState . It would also help to include some screenshots of your prefab setups (maybe you missed some things there ).

1 Like

Thanks @mihaivladan,
You have solved it already.
While I was gathering the code you requested and drafting the reply I noticed that this line was missing in the Move() method of PlayerBaseState.cs:

stateMachine.Controller.Move((motion + stateMachine.ForceReceiver.Movement) * deltaTime); 

I added the line saved and tested in Unity and it works as expected now. I don’t know how I could have missed that.

Thanks again.
-R

1 Like

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms