Whats the difference between a rigid body and a collider?

I know it's noobish question, sorry. :P

2 Likes

2 Answers

2
  • A Collider is the "physical form" of objects. There are several types of colliders, such as box shaped, sphere shaped, capsule shaped or even custom (mesh) shaped (and then some!).

  • A Colliders' responsibility is to aid collision detection in any way. It can be used for triggers, for physics or other uses.

  • A Rigidbody is a representation of a rigid body in space. It is used by the physics engine to perform collision response and movement of objects.

  • A Rigidbody makes use of a Collider to define it's shape.

Can you please tell me the difference between transform.position.x and rigidbody.position.x because when i use it in code like shown below, rigidbody.position = new Vector3(rigidbody.position.x,0,16.0f); or, transform.position = new Vector3(rigidbody.position.x,0,16.0f); or, transform.position = new Vector3(transform.position.x,0,16.0f); they all do the same thing.. so i was just wondering what is the difference between them.... I know its a noobish question but I just started learning unity 2 days before.

This post may help as well…

Note really. You should call Update before you read and modify your properties and finish with ApplyModifiedProperties. That's the normal procedure. It's [explained in the docs][1], though as usual not that clearly ^^. The examples might also be misleading because creating a SerializedObject will automatically call Update. Also the default behaviour of OnInspectorGUI will also call Update automatically. [1]: https://docs.unity3d.com/ScriptReference/SerializedObject.html