Kizspy | Question: 14
(Choose 1 answer)
}
Given the following script for handling dynamic collision reactions, what will be the effect when the
GameObject collides with another object?
using UnityEngine;
public class DynamicCollision Reaction: MonoBehaviour
public float forceMagnitude 10f;
private Rigidbody rb;
void Start()
rb GetComponent<Rigidbody>();
void OnCollisionEnter (Collision collision)
{
}
Vector3 collisionForce = collision.impulse/Time.fixedDelta Time;
Vector3 applied Force = collisionForce.normalized *forceMagnitude;
rb.AddForce(applied Force, ForceMode.Impulse);
A. The GameObject will move randomly
B. The GameObject will apply a force away from the collision
C. The GameObject will stop moving
D. The GameObject will change color