Kizspy | Question: 16
(Choose 1 answer)
Analyze the following code and determine what happens when the Apply Forces method is called in the script.
using UnityEngine;
public class ComplexForce: MonoBehaviour
public float mainForce = 20f;
public float sideForce = 5f;
private Rigidbody rb;
void Start()
rb GetComponent<Rigidbody>();
public void ApplyForces()
Vector3 combinedForce = (Vector3.up* mainForce) + (Vector3.right * sideForce);
rb.AddForce(combined Force, ForceMode.Impulse);
}
A. The GameObject will move upwards and to the left
B. The GameObject will move downwards and to the right
C. The GameObject will move upwards and to the right
D. The GameObject will remain stationary