Consider a Rigidbody2D with initial velocity (2, 3). After running the code below, what will be the new velocity?
Rigidbody2D rb = GetComponent<Rigidbody2D>();
rb.velocity = new Vector2(5, rb.velocity.y);Remember that only the x component of velocity is changed.
The code sets the x velocity to 5 but keeps the y velocity unchanged at 3.
Which property of Rigidbody2D determines how much gravity affects the object?
Think about the property that scales gravity force.
gravityScale multiplies the global gravity to control how strongly gravity affects the Rigidbody2D.
Given this code, the Rigidbody2D does not move when applying velocity. What is the likely cause?
Rigidbody2D rb = GetComponent<Rigidbody2D>(); rb.velocity = new Vector2(10, 0);
Check Rigidbody2D settings that disable physics movement.
If 'Is Kinematic' is true, Rigidbody2D ignores velocity and physics forces, so it won't move automatically.
Choose the correct syntax to add a force of (0, 10) to a Rigidbody2D named rb.
Remember the method signature and vector type for 2D physics.
AddForce expects a Vector2 argument. Option B uses correct syntax and vector type.
You want a Rigidbody2D to move freely but never rotate. Which code snippet achieves this?
Look for Rigidbody2D constraints that affect rotation only.
Setting constraints to FreezeRotation stops rotation but allows position movement.