Colliders and Different Methods of Moving Objects in Unity

One problem with students starting to work with Unity is to understand when colliders work and when they do not work. This very simple demonstration shows how Physics::AddForce(), CharacterController:: SimpleMove() and Translate.Transform() behaves with colliders. Moving a GameObject using Physics and CharacterController based methods interacts with collisions whereas Transform::Translate() does not as seen in the video. Moreover, Translate does not work with MonoBehavior::OnTriggerEnter().


Physics::AddForce():

public class PhysicMove : MonoBehaviour {

	void Start () {
		rigidbody.AddForce (new Vector3 (100, 0, 0));
	}
}

CharacterController::SimpleMove()

public class Move : MonoBehaviour {

	public float speed;

	private CharacterController controller;

	void Start () {
		controller = GetComponent ();
	}
	
	void Update () {
		controller.SimpleMove (new Vector3 (1, 0, 0) * Time.deltaTime * speed);
	}
}

Transform::Translate()

public class MoveTranslate : MonoBehaviour {

	public float speed;

	void Start () {
		enabled = false;
	}

	void Update () {
		transform.Translate (new Vector3 (1, 0, 0) * Time.deltaTime * speed);
	}
}