Challenge - 5 Problems
Rigidbody Force Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
ā Predict Output
intermediate2:00remaining
What is the velocity after applying force with ForceMode.Force?
Consider a Rigidbody with mass 2 kg initially at rest. You apply a force of (4, 0, 0) using
ForceMode.Force for one fixed update frame. What will be the velocity of the Rigidbody after this frame?Unity
Rigidbody rb = GetComponent<Rigidbody>(); rb.mass = 2f; rb.velocity = Vector3.zero; Vector3 force = new Vector3(4f, 0f, 0f); rb.AddForce(force, ForceMode.Force); // Assume fixedDeltaTime = 0.02 seconds
Attempts:
2 left
š” Hint
Remember ForceMode.Force applies force over time, so velocity changes by acceleration * deltaTime.
ā Incorrect
ForceMode.Force applies a continuous force. Acceleration = Force / Mass = 4 / 2 = 2 m/s². Velocity change = acceleration * deltaTime = 2 * 0.02 = 0.04 m/s.
ā Predict Output
intermediate2:00remaining
What is the velocity after applying force with ForceMode.Impulse?
A Rigidbody with mass 3 kg is at rest. You apply an impulse force of (6, 0, 0) using
ForceMode.Impulse. What is the velocity immediately after applying this impulse?Unity
Rigidbody rb = GetComponent<Rigidbody>(); rb.mass = 3f; rb.velocity = Vector3.zero; Vector3 impulse = new Vector3(6f, 0f, 0f); rb.AddForce(impulse, ForceMode.Impulse);
Attempts:
2 left
š” Hint
Impulse changes velocity immediately by impulse / mass.
ā Incorrect
Impulse changes velocity instantly: velocity = impulse / mass = 6 / 3 = 2 m/s on x-axis.
š§ Debug
advanced2:00remaining
Why does velocity not change after AddForce with ForceMode.Acceleration?
You have this code snippet:
Rigidbody rb = GetComponent();
rb.velocity = Vector3.zero;
rb.AddForce(new Vector3(10, 0, 0), ForceMode.Acceleration);
But after running, velocity remains zero. What is the most likely reason?
Unity
Rigidbody rb = GetComponent<Rigidbody>(); rb.velocity = Vector3.zero; rb.AddForce(new Vector3(10, 0, 0), ForceMode.Acceleration);
Attempts:
2 left
š” Hint
Check Rigidbody settings that disable physics simulation.
ā Incorrect
If Rigidbody is kinematic, physics forces do not affect velocity. AddForce has no effect.
š§ Conceptual
advanced2:00remaining
How does ForceMode.VelocityChange differ from ForceMode.Impulse?
Which statement correctly describes the difference between
ForceMode.VelocityChange and ForceMode.Impulse when applied to a Rigidbody?Attempts:
2 left
š” Hint
Think about how mass affects velocity change in each mode.
ā Incorrect
ForceMode.VelocityChange changes velocity directly ignoring mass. Impulse applies force that depends on mass.
ā Predict Output
expert3:00remaining
What is the final velocity after multiple AddForce calls with different ForceModes?
A Rigidbody with mass 4 kg starts at zero velocity. The following code runs in one FixedUpdate:
rb.AddForce(new Vector3(8, 0, 0), ForceMode.Force);
rb.AddForce(new Vector3(4, 0, 0), ForceMode.Impulse);
rb.AddForce(new Vector3(2, 0, 0), ForceMode.VelocityChange);
Assuming fixedDeltaTime = 0.02 seconds, what is the final velocity vector?
Unity
Rigidbody rb = GetComponent<Rigidbody>(); rb.mass = 4f; rb.velocity = Vector3.zero; rb.AddForce(new Vector3(8f, 0f, 0f), ForceMode.Force); rb.AddForce(new Vector3(4f, 0f, 0f), ForceMode.Impulse); rb.AddForce(new Vector3(2f, 0f, 0f), ForceMode.VelocityChange);
Attempts:
2 left
š” Hint
Calculate velocity changes from each AddForce separately and sum them.
ā Incorrect
ForceMode.Force: acceleration = 8/4=2 m/s², velocity change = 2*0.02=0.04
ForceMode.Impulse: velocity change = 4/4=1
ForceMode.VelocityChange: velocity change = 2 (ignores mass)
Total velocity = 0.04 + 1 + 2 = 3.04 m/s on x-axis.