I have a certain condition in which a gameObject can be moved only in x axis.I am using mouse x delta change as input (Input.GetAxis(“Mouse X”)) multiplied by some sensitivity. i have defined boundary value for x, so that it is clamped.
the problem is that the gameObject moves some values greater than boundary value then resets back to boundary position. it is not stopping immediately at that point.
- using physics calculations in Fixedupdate().
- moving using rigidbody.MovePosition() method.