Kizspy | Question: 19
(Choose 1 answer)
Given the following script snippet attached to a GameObject with a Rigidbody component, what will happen
when the space bar is pressed?
public Rigidbody rb;
public float forceMagnitude = 500f;
void Update()
if(Input.GetKeyDown(KeyCode. Space))
rb.AddForce(Vector3.up* forceMagnitude);
A. The GameObject will move downward with a force of 500 Newtons.
B. The GameObject will rotate around the Y-axis.
C. The GameObject will move upward with a force of 500 Newtons.
D. The GameObject's velocity will decrease by 500 units per second.