- Home /
Weird physics
Hi, im new to unity 3d. I was making a 3d shooter game but i ran into a problem.
(I can't record anything right now so i need to try to explain this the best i can) So the problem is that the player falls to the ground SUPER slowly (it stays the same even if its set to 1 or 1000000), and after it lands, the player starts getting pushed towards one direction (this i can't explain well because i have no idea of what is causing it and i have not found any way to do anything about it).
Here is my movement code:
if(movable){
move = transform.right * Input.GetAxisRaw("Horizontal") * moveSpeed + transform.forward * Input.GetAxisRaw("Vertical") * moveSpeed; //move is a vector3
rb.velocity = move; //rb is my rigidbody
}
I have tried a lot of things and just can't find a solution.
Answer by Lenny991 · Sep 01, 2021 at 12:20 PM
If anyone was getting into the same problem, here is how i found a way to fix it
i changed the original code to
if(movable){ move = transform.right * Input.GetAxisRaw("Horizontal") * moveSpeed + transform.forward * Input.GetAxisRaw("Vertical") * moveSpeed; //move is a vector3 move.y = rb.velocity.y; //this was causing it to fall so slowly. rb.velocity = move; //rb is my rigidbody }
and after that i made a physics material and set the frictions to 0 :)