I decided to use a rigidbody for my player instead of a character controller for a number of reasons. So far it’s going great, but I have a slight problem. If I run against a wall and I jump and touch it in the air, I will get stuck in it and stay in the air for as long as I press the movement button with the direction against the wall.
All the movement functions are in FixedUpdate. Here’s my line for the movement:
if(rigidbody.velocity.magnitude < maxSpeed)
rigidbody.velocity += transform.TransformDirection(Vector3(serverHInput * 150 * Time.deltaTime, 0, serverVInput * 150 * Time.deltaTime));
I’ve also tried transform.Translate andrigidbody.AddForce,none of them fixes the problem.
Also if I’m walking against a wall and I try to jump, the player won’t jump.