In another question somebody suggested I use Time.deltaTime to help smooth out the movement of an object. However the script itself works fine and does what I need it to do.
I kind of understand how/why Time.deltaTime would be beneficial but not how to change the existing script to use it (or even if it really needs to be changed)
void FixedUpdate ()
{
float moveHorizontal = Input.GetAxis ("Horizontal");
Vector3 movement = new Vector3 (moveHorizontal, 0.0f, 0);
GetComponent<Rigidbody>().velocity = movement * speed;
GetComponent<Rigidbody>().position = new Vector3(Mathf.Clamp (GetComponent<Rigidbody>().position.x, Min, Max), transform.position.y, transform.position.z);
}
Is Time.deltaTime going to be beneficial here and if so how would I incorporate it into the script
???