Trying to figure out how to get onCollisionEnter to trigger when two rigidbody objects collide.
I have a rigidbody unit sphere sitting at the origin (gravity off). When it’s pressed, another rigidbody unit sphere is instantiated nearby. The two bounce off but onCollisionEnter is not triggered. How do you get the collision to detect?
function OnMouseDown(){ var o:GameObject = Instantiate(t2,transform.position+Vector3(0,0,0.5),Quaternion.identity); }
–
Updated, where the spawned rb does not initially collide with the other:
function OnMouseDown(){ var o:GameObject = Instantiate(t2,transform.position+Vector3(0,2,0),Quaternion.identity); o.rigidbody.useGravity = true; }