Currently I have a custom player controller for movement. As I am building a network game, I would like to have as little physics as possible. Right now, when I move player up the hill, player slides down. Predictable.
This is my handler right now. I am manually changing the position of the player based on its velocity in the update function, as you can see.
Direction moveDirection = DPad.MoveDirection();
Vector3 velocity;
if (moveDirection == Direction.N)
velocity = new Vector3(0, 0, 1);
else if (moveDirection == Direction.S)
velocity = new Vector3(0, 0, -1);
else if (moveDirection == Direction.W)
velocity = new Vector3(-1, 0, 0);
else
velocity = new Vector3(1, 0, 0);
GetComponent<Rigidbody>().position += velocity * CalculateSpeed() * Time.deltaTime;
Is there some way to make the player not slide down anything - and even better, when a player moves into a wall at an angle, let’s say, is there an easy way to stop the player right there, instead of allowing it to move along direction of the wall?