I’m making a basic thing for class. What i am trying to do is this. When i throw a ball and it connects with the collision of the box i have, i want it to disappear and have my shattered box prefab come up. The problem i am having is the colision. I can’t get this script to work. Can anyone help? Using javascript.
var remains: GameObject;
function OnCollisionEnter (collision : collision)
if (Collision.gameObject == something);
function Update()
{
{
Instantiate(remains, transform.position, transform.rotation);
Destroy(gameObject);
}
}