Rigidbody Component in Unity
Notes:
Rigidbody Component in Unity:
- is a component which tells physics system that this game object is a non deformable object; which is affected by forces like gravity, linear drag, angular drag, or any other physics forces, and can participate in collisions, creating joints.
Non deformable object:
- is an object whose shape does not change; even when applied by an infinite force.
- I.e. the object; which does not break, twists or deform
Rigidbody component properties:
Mass:
- indicates mass of an object in Kg(s)
- is used to increase or decrease the weight of a game object
Drag / Damping / Friction:
- indicates resistance to linear velocity
- is used to slow down the motion of a game object
Angular Drag:
- indicates resistance to angular velocity
- is used to slow down the rotation of a game object
Use Gravity:
- indicates whether this game object is affected by gravity or not
Is Kinematic:
- indicates whether this game object is affected by physics or not
- but it does affect surrounding game objects
Constraints:
- Freeze position:
-- used to enable or disable motion along x, y or/and z axis
- Freeze rotation:
-- used to enable or disable rotation around x, y or/and z axis
Interpolate:
- Corrective feature, used solve jittery motion
- As physics runs at fixed frame rate; some time graphics and character movement does not match, you find jitter motion; especially when camera follows the main character, then you enable interpolate to solve jittery motion.
Collision detection:
- is a corrective feature, used to solve collision miss error on very fast objects
-- Discrete: default
-- Continuous: set to object to which fast object hits (wall)
-- Continuous Dynamic: set to fast object (bullet)
Note:
If you drop 2 objects (with same or different mass) from the same distance and at the same time, and both are subject only to the force of gravity; then they both land on the ground at the same time. Because they both experience the same gravitational force.