0
0
Unityframework~10 mins

Rigidbody forces and velocity in Unity - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to apply a force to the Rigidbody.

Unity
rigidbody.[1](Vector3.forward * 10f);
Drag options to blanks, or click blank then click option'
AAddForce
BAddTorque
CSleep
DMovePosition
Attempts:
3 left
💡 Hint
Common Mistakes
Using AddTorque instead of AddForce.
Trying to move Rigidbody by setting position directly.
2fill in blank
medium

Complete the code to set the Rigidbody's velocity to move right at 5 units per second.

Unity
rigidbody.[1] = Vector3.right * 5f;
Drag options to blanks, or click blank then click option'
AangularVelocity
Brotation
Cposition
Dvelocity
Attempts:
3 left
💡 Hint
Common Mistakes
Setting angularVelocity instead of velocity.
Trying to set position directly to move the Rigidbody.
3fill in blank
hard

Fix the error in applying force to the Rigidbody to make it jump upwards.

Unity
rigidbody.[1](new Vector3(0, 5f, 0), ForceMode.Impulse);
Drag options to blanks, or click blank then click option'
AAddForce
BAddTorque
CMovePosition
DSleep
Attempts:
3 left
💡 Hint
Common Mistakes
Using AddTorque instead of AddForce for jumping.
Not using ForceMode.Impulse for instant force.
4fill in blank
hard

Fill both blanks to create a dictionary mapping Rigidbody names to their speeds, filtering only those moving faster than 3 units.

Unity
var speeds = rigidbodies.Where(rb => [2].magnitude > 3f).ToDictionary(rb => [1], rb => [2].magnitude);
Drag options to blanks, or click blank then click option'
Arb.name
Brb.velocity
Crigidbody
Dvelocity
Attempts:
3 left
💡 Hint
Common Mistakes
Using variable names inconsistently.
Using velocity without referencing the Rigidbody variable.
5fill in blank
hard

Fill all three blanks to set the Rigidbody's velocity to zero and disable gravity.

Unity
rigidbody.[1] = Vector3.zero;
rigidbody.[2] = false;
rigidbody.[3]();
Drag options to blanks, or click blank then click option'
Avelocity
BuseGravity
CSleep
DAddForce
Attempts:
3 left
💡 Hint
Common Mistakes
Forgetting to disable gravity.
Using AddForce instead of Sleep to stop Rigidbody.