I am using the following code to move my obejct with a rigid body around: Code (CSharp): public class Movement : MonoBehaviour { public float rotSpeed; public float playerSpeed; void Update() { if (Input.GetKey (KeyCode.D)) { transform.Rotate (Vector3.up, Time.deltaTime * rotSpeed); } else if (Input.GetKey (KeyCode.A)) { transform.Rotate (-Vector3.up, Time.deltaTime * rotSpeed); } if (Input.GetKey (KeyCode.W)) { transform.Translate (Vector3.forward * Time.deltaTime * playerSpeed); { if (Input.GetKey(KeyCode.LeftShift)) transform.Translate (Vector3.forward * Time.deltaTime * playerSpeed * 2); } } else if (Input.GetKey (KeyCode.S)) { transform.Translate (-Vector3.forward * Time.deltaTime * playerSpeed); } } } How do I have to change the script to make the object not bumping continuously while moving into a collider? It should look like the default fpscontroller.
The suggestion I see often made, and am myself making, is that if you have a rigid body, apply forces to the rigid body rather than change the transform translate. I'm not certain I understand the behavior you're getting, but I think I do and it's probably because the object is partially entering the collider, then physics takes over and the object get's pushed out.
Or rigidbody.AddForce. Though for his purpose of making it look like the default fps controller rb.MovePosition is probably the most accurate option.