Gravity issue on MouvementController using RigidBody when going down a slope
So i created a script that handles mouvement for my player (mouving around ,going down and up slopes ...) but i run into a probleme, since i'm using a RigidBody not a CharacterController when i go up slope and stop on the middle of it the gravity pulls me backward wich is fine and it's something i want but the probleme is when i move forward, what happens is that the gravity velocity pulls me backward when i'm trying to go forward. This probleme wouldnt have appeared if my character wasnt a sphere but sadly my charactere is a sphere so it always roll down when gravity is applied to it .
What i want is to somehow stop the gravity for a second or reset it to zero when i move my character, and when i'm going up a slope so it wont hold me back. I tried :
if(grounded) rb.velocity = Vector3.zero;
but i dont think it's the right approach.
Your answer
Follow this Question
Related Questions
Allowing player to glide/fall slowly 2 Answers
Player still move left&right in MenuUI 0 Answers
How to create an advanced hover for character 0 Answers
Gravity is not working 0 Answers
After added a rigidbody in a GameObject, it moves on rotation 2 Answers