I’m making a networked FPS and want to have realistic physics, but when i drop the player that is being controlled, the gravity is extremely slow (it falls at around 0.1 units per second). But, when I drag an instance of the player prefab into the scene (one not controlled by anyone) it falls at a normal speed.
every time you move (maybe every update call idk) you set your char velocity = 0 here : Rb.velocity = Vector3.zero;
that prevents gravity.
its not necessary as far as i see in your code. soo, i suggest just delete that line. and you are good to go.
I have narrowed down the problem to my movement function:
private void Move()
{
Rb.velocity = Vector3.zero;
float hMove = Input.GetAxisRaw("Horizontal");
float vMove = Input.GetAxisRaw("Vertical");
Vector3 moveHorizontal = transform.right * hMove;
Vector3 moveVerical = transform.forward * vMove;
Vector3 Velocity= (moveHorizontal + moveVerical).normalized * speed;
Rb.velocity = Velocity;
if (Rb.velocity.x == 0 && Rb.velocity.z == 0)
{
Animator.SetBool("IsWalking", false);
}
else
{
Animator.SetBool("IsWalking", true);
}
}
I assume that the Y velocity is being overwritten but i don’t know how to fix that