,Why is my character sliding? (Rigid Body)
Whatta finna pop?
I have an issue with my game development. You see, I just created a movement script for my character. He is a rigid body object. He only has an empty with a camera parented to him. This is my script:
void Update () {
if (Input.GetKey("w"))
{
rb.AddForce(0, 0, 3000*Time.deltaTime);
}
if (Input.GetKey("s"))
{
rb.AddForce(0, 0, -3000*Time.deltaTime);
}
if (Input.GetKey("a"))
{
rb.AddForce(-3000*Time.deltaTime, 0, 0);
}
if (Input.GetKey("d"))
{
rb.AddForce(3000*Time.deltaTime, 0, 0);
}
}
Again, my issue is that he just keeps on sliding! He slides a lot after I hit a key. What should I do?
Comment