Use Rigidbody to Enable Physics
Build on the fundamentals of physics by learning Rigidbody.
Fundamentals of Rigidbody and Transform
The key element that gives a GameObject the ability to feel and apply physical forces is the Rigidbody. Let’s first review some fundamentals to better grasp how the “Rigidbody” component works.
The “Scene” view in Unity Editor shows us the GameObjects present inside the World Space of the respective scene. However, the position, orientation, and size of a GameObject inside the World Space are defined by its “Transform” component.
Note: The “Transform” component is included with every GameObject. However, unlike other components, it can’t be taken out.
When we move or rotate a GameObject in the “Scene” view, the corresponding parameter in the “Transform” component gets altered (as shown below):
The following illustration demonstrates the “Rotation” attribute:
Note: Therefore, a Rigidbody modifies the GameObject’s “Transform” parameters at runtime to create the effect that an object is moving.
Just as in classical physics, where a force causes a change in the velocity of an object, which in turn causes a change in the displacement of that same object, Unity’s physics engine does the necessary ...