But the object does not move. What is the most likely reason?
medium
A. AddForce only works with 3D Rigidbody, not Rigidbody2D
B. The force vector is too small to move the object
C. The Rigidbody2D's Body Type is set to Static
D. You need to call rb.MovePosition() instead
Solution
Step 1: Check Rigidbody2D Body Type effect
If Body Type is Static, physics forces do not move the object.
Step 2: Evaluate other options
Force vector (10,0) is enough; AddForce works with Rigidbody2D; MovePosition is for manual moves, not force.
Final Answer:
The Rigidbody2D's Body Type is set to Static -> Option C
Quick Check:
Static body ignores forces [OK]
Hint: Static Rigidbody2D ignores forces; use Dynamic [OK]
Common Mistakes:
Using Static body type expecting movement
Thinking AddForce is invalid for Rigidbody2D
Confusing MovePosition with AddForce
5. You want to create a 2D game object that moves left and right smoothly using physics and stops instantly when no input is given. Which Rigidbody2D settings and code approach should you use?
hard
A. Set Body Type to Dynamic, use rb.velocity to set horizontal speed, and set velocity to zero when no input
B. Set Body Type to Kinematic, use rb.AddForce to move, and rely on friction to stop
C. Set Body Type to Static, move object by changing transform.position directly
D. Set Body Type to Dynamic, use rb.MovePosition for movement, and ignore velocity
Solution
Step 1: Choose Rigidbody2D Body Type for physics movement
Dynamic body type allows physics-based movement and velocity control.
Step 2: Use velocity for smooth movement and instant stop
Setting rb.velocity directly controls speed and can be set to zero to stop immediately.
Step 3: Evaluate other options
Kinematic bodies don't respond to forces; Static bodies don't move; MovePosition is for manual moves, not smooth physics velocity control.
Final Answer:
Set Body Type to Dynamic, use rb.velocity to set horizontal speed, and set velocity to zero when no input -> Option A
Quick Check:
Dynamic + velocity control = smooth move and instant stop [OK]
Hint: Use Dynamic Rigidbody2D and set velocity for smooth control [OK]
Common Mistakes:
Using Static or Kinematic body types for physics movement
Relying on AddForce without velocity control for instant stop
Moving object by transform.position ignoring physics