Properties of Rigidbody components

Let's get familiar with the properties of a Rigidbody:

  • Mass: If we look at the Inspector panel of a Rigidbody component, we will see Mass as one of the listed properties. This property of a Rigidbody defines the mass that should be based on the relative size and density of the object that is attached to it. The mass of a Rigidbody defines how much force is required to move the Rigidbody fast or slow. We can calculate the force using Newton's law of motion as follows:

    F=ma, that is, Force = Mass x Acceleration

  • Drag: This property defines the linear velocity due to air resistance. For example, if we need to add an outer-space behavior to a game object, we set this value as 0. An object with mass 1 should have a Drag value of 998 to resist the force of gravity.
  • Angular Drag: This property defines the angular velocity due to air resistance. For example, if we need to add an infinitely-spinning-unless-used external force behavior on a game object, we set this value as 0.
  • Use Gravity: If we want our game object to be affected by gravity, we use this behavior.
  • Is Kinematic: To add kinematic behavior, we set this to true. By setting its behavior to true, we can directly change the position and orientation of the Rigidbody using its Transform properties.
  • Interpolate: Using this property, we make a Rigidbody move smoothly. We can adjust the Interpolate method using None, Interpolate, and Extrapolate, as seen in the following screenshot:
    Properties of Rigidbody components

    Using None, no interpolation is applied; using Interpolate, we smoothly transform based on its previous frame; and in Extrapolate, we smoothly transform based on its estimated next frame.

  • Collision Detection: Using this property, we can determine how the Rigidbody will perform collision detection with other Rigidbodies. This property consists of the following subproperties:
    • Discreet: By setting this property, we use the simplest form of collision detection. At each frame, an intersection test is done. The drawback of this property is that small, fast moving objects will pass directly through solid objects.
    • Continuous: By setting this property, a Rigidbody performs continuous collision detection against all the other static colliders.
    • Continuous Dynamic: By setting this property, a Rigidbody detects the collision with fast moving objects.
  • Constraints: This property is used for Physics Rigidbodies. Using this property, we can make the position and orientation of a Rigidbody constraint. This property consists of the following subproperties:
    • FreezePosition: By setting this property, a Rigidbody constrains the linear motion
    • FreezeRotation: By setting this property, the rotation of a Rigidbody is prevented
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.142.212.160