0
0
Unityframework~10 mins

Rigidbody 3D component in Unity - Step-by-Step Execution

Choose your learning style9 modes available
Concept Flow - Rigidbody 3D component
Add Rigidbody Component
Physics Engine Controls Object
Apply Forces or Gravity
Object Moves According to Physics
Check Collisions and Responses
Update Object Position and Rotation
The Rigidbody 3D component lets Unity's physics engine control an object, moving it with forces and gravity, and handling collisions.
Execution Sample
Unity
void Start() {
  Rigidbody rb = GetComponent<Rigidbody>();
  rb.AddForce(new Vector3(0, 10, 0), ForceMode.Impulse);
}
This code gets the Rigidbody component and applies an instant upward force to make the object jump.
Execution Table
StepActionRigidbody StatePositionVelocityOutput
1Get Rigidbody componentActive(0,0,0)(0,0,0)Ready to apply forces
2Apply upward impulse forceActive(0,0,0)(0,10,0)Velocity changes instantly
3Physics update frame 1Active(0,0.1,0)(0,9.02,0)Object moves up slightly
4Physics update frame 2Active(0,0.28,0)(0,8.14,0)Object continues moving up
5Physics update frame 3Active(0,0.53,0)(0,7.26,0)Object slows down due to gravity
6Physics update frame NActive(0,y,0)(0,v,0)Object eventually falls back down
7Collision detectedActive(0,0,0)(0,0,0)Object stops moving on ground
💡 Simulation continues until object stops or script disables Rigidbody
Variable Tracker
VariableStartAfter Step 2After Step 3After Step 4After Step 5Final
Position(0,0,0)(0,0,0)(0,0.1,0)(0,0.28,0)(0,0.53,0)(0,0,0)
Velocity(0,0,0)(0,10,0)(0,9.02,0)(0,8.14,0)(0,7.26,0)(0,0,0)
Rigidbody StateActiveActiveActiveActiveActiveActive
Key Moments - 3 Insights
Why does the object's velocity change instantly after applying AddForce with ForceMode.Impulse?
Because ForceMode.Impulse applies an immediate change to velocity, as shown in execution_table step 2 where velocity jumps from (0,0,0) to (0,10,0).
Why does the position keep increasing even though no new forces are applied after the impulse?
Because the Rigidbody's velocity carries the object upward, and gravity gradually reduces velocity over time, seen in steps 3 to 5.
What happens when the object collides with the ground?
The Rigidbody stops moving and velocity resets to zero, as shown in step 7 where position is at ground level and velocity is (0,0,0).
Visual Quiz - 3 Questions
Test your understanding
Look at the execution table, what is the velocity of the Rigidbody right after applying the impulse force (Step 2)?
A(0,10,0)
B(0,0,0)
C(10,0,0)
D(0,-10,0)
💡 Hint
Check the 'Velocity' column at Step 2 in the execution_table.
At which step does the Rigidbody start slowing down due to gravity?
AStep 2
BStep 5
CStep 3
DStep 7
💡 Hint
Look at the velocity values decreasing in the execution_table between steps 3 to 5.
If we remove the Rigidbody component, what would happen to the object's movement?
AIt would still move with physics forces.
BIt would not move due to physics.
CIt would move faster.
DIt would fall faster.
💡 Hint
Refer to the concept_flow where Rigidbody is needed for physics control.
Concept Snapshot
Rigidbody 3D component lets Unity physics move objects.
Add Rigidbody to object to enable physics.
Use AddForce to push or pull it.
ForceMode.Impulse changes velocity instantly.
Gravity pulls object down automatically.
Collisions stop or bounce the object.
Full Transcript
The Rigidbody 3D component in Unity allows the physics engine to control an object. When you add a Rigidbody, the object can move with forces like pushes or gravity. In the example, we get the Rigidbody component and apply an upward impulse force, which instantly changes the object's velocity upwards. Each physics update moves the object according to velocity and gravity slows it down over time. Eventually, the object collides with the ground and stops moving. This shows how Rigidbody handles movement and collisions automatically.