Q14.webp
Lucy_boy1

Q14.webp

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

Thông tin

Category
PRU212
Thêm bởi
Lucy_boy1
Ngày thêm
Lượt xem
3,660
Lượt bình luận
11
Rating
0.00 star(s) 0 đánh giá

Share this media

Back
Bên trên Bottom