0
0
Unityframework~10 mins

Why physics simulate realistic behavior in Unity - Test Your Understanding

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

Complete the code to manually apply gravity to a Rigidbody component in Unity each FixedUpdate.

Unity
rigidbody.[1] += Physics.gravity * Time.fixedDeltaTime;
Drag options to blanks, or click blank then click option'
AangularVelocity
Bvelocity
Cdrag
Dmass
Attempts:
3 left
💡 Hint
Common Mistakes
Using mass instead of velocity to apply gravity.
Trying to set drag to gravity value.
2fill in blank
medium

Complete the code to add a force to a Rigidbody to simulate a push.

Unity
rigidbody.AddForce([1] * forceAmount);
Drag options to blanks, or click blank then click option'
AVector3.forward
BVector3.one
CVector3.zero
DVector3.up
Attempts:
3 left
💡 Hint
Common Mistakes
Using Vector3.zero which applies no force.
Using Vector3.up which pushes upward.
3fill in blank
hard

Fix the error in the code to correctly simulate friction on a Rigidbody.

Unity
PhysicMaterial material = new PhysicMaterial();
material.dynamicFriction = [1];
rigidbody.sharedMaterial = material;
Drag options to blanks, or click blank then click option'
A"high"
B5
C0.5f
Dtrue
Attempts:
3 left
💡 Hint
Common Mistakes
Using an integer instead of a float.
Using a string or boolean value.
4fill in blank
hard

Fill both blanks to create a dictionary that maps object names to their Rigidbody mass if mass is greater than 1.

Unity
if (rigidbody.[2] > 1f) {
  var heavyObjects = new Dictionary<string, float> { { [1], rigidbody.[2] } };
}
Drag options to blanks, or click blank then click option'
A"Player"
Bmass
Cvelocity
D"Enemy"
Attempts:
3 left
💡 Hint
Common Mistakes
Using velocity instead of mass.
Using a variable instead of a string for the key.
5fill in blank
hard

Fill all three blanks to create a dictionary comprehension that maps object names to their velocity if velocity magnitude is greater than 2.

Unity
if (rigidbody.[3].magnitude > 2f) {
  var fastObjects = new Dictionary<string, Vector3> { { [1], rigidbody.[2] } };
}
Drag options to blanks, or click blank then click option'
A"NPC"
Bvelocity
D"Ally"
Attempts:
3 left
💡 Hint
Common Mistakes
Using different properties for value and condition.
Using incorrect string keys.