rigidbody movement is not smooth
i am new to the community so i'm sure this question is answered but i'm asking it again to get the reasoning why my code is not smooth and also how to make it smooth, im very new at this so any details you think are not good to explain would probably be best if you explain them.
void Update()
{
Debug.Log("the update function is working");
if(Input.GetKeyDown("w"))
{
Debug.Log("the W key was pressed");
GetComponent<Rigidbody>().velocity = Vector3.forward * speed * Time.deltaTime;
//Vector3.forward* playerSpeed *Time.deltaTime;
}
if(Input.GetKeyDown("a"))
{
Debug.Log("the A key was pressed");
GetComponent<Rigidbody>().velocity = Vector3.left * speed * Time.deltaTime;
}
if (Input.GetKeyDown("s"))
{
Debug.Log("the S key was pressed");
GetComponent<Rigidbody>().velocity = Vector3.back * speed * Time.deltaTime;
}
if (Input.GetKeyDown("d"))
{
Debug.Log("the D key was pressed");
GetComponent<Rigidbody>().velocity = Vector3.right * speed * Time.deltaTime;
}
}
Comment
Your answer
Follow this Question
Related Questions
rb. MovePosition slowly enters another Collider 0 Answers
Need help with high speed collisions, sanity dwindling 1 Answer
Help converting a character controller script to rigidbody 1 Answer
Move to mouse position, (if start pressing from the character) - HELP 0 Answers
Hearth based health system help 0 Answers