In this chapter, we will learn about the types of Rigidbody components and their properties. To detect collision, add gravity, and several other Physics functionalities, a game object must have a Rigidbody component.
In this chapter, we will cover the following topics:
We can handle a Rigidbody component using a script as well as by manually applying linear and angular velocity.
We enable our game objects to act under the control of Physics using Rigidbodies. Here, we will learn how to use and handle a Rigidbody component. A Rigidbody can be handled in two ways:
To influence a game object by gravity or forces, the game object must have a Rigidbody. When a Rigidbody is completely controlled by the engine, it is called a Physics Rigidbody. We can manually apply forces and torque to handle linear and angular velocity of a game object. Manual implementation of forces and torque gives you the freedom to get the desired effect. Let's look at an example of a Rigidbody.
Use the following steps to apply a Physics Rigidbody:
Physics Rigidbody
.As shown in the previous steps, we can get the desired effect using the different properties.
When we check the Is Kinematic property of a Rigidbody, it is known as a Kinematic Rigidbody. We cannot apply forces or torque manually to a Kinematic Rigidbody. We can move a Kinematic Rigidbody by changing the values of a GameObject's Transform component. This is useful for moving platforms or animated HingeJoint GameObjects where the engine does not handle the object directly and where we can manipulate its Transform property as per our requirement.
We can use this property by checking it in the Inspector panel, as shown in the previous screenshot. Now, we will learn about the properties of a Rigidbody and their implementation.
18.116.65.130