Hi Chris,
I'm making a game with direct control and want to move the player only on x axis (like a platformer).
I disabled UP and DOWN movement OnStart and everything looks fine.
My big problem is that when I turn the player from left to right (or opossite) the player slightly moves on z axis on each change of direction, I guess due to the turn animation. I want to keep the player striclty on the X axis.
The contraints on the Rigidbody component doesnt seem to do anything.
Any ideas?
Comments
The Rigidbody constraints won't change anything, but as a last resort you could place colliders around the player to contain him within the Z-plane.
AC's freezing of the Rigidbody rotation can be disabled by removing line 1007 in Char.cs (in the latest release):
_rigidbody.constraints = RigidbodyConstraints.FreezeRotation;
If you can get good results controlling it yourself, I'll consider making it optional. However, it may be that a custom script is necessary to get the best results. Raycasting the floor to work out the orientation, and then rotating the mesh as a child object, would give you better control over it - allowing you to prevent sudden changes etc.