Just wondering if there’s an easier way to check if certain game objects are destroyed. Right now I’m trying this, but sometimes it works and sometimes it doesn’t:
var Ball : GameObject;
var Test : GameObject;
function Update () {
var hit : RaycastHit;
for (var evt : iPhoneTouch in iPhoneInput.touches)
{
if (evt.phase == iPhoneTouchPhase.Began)
{
var ray = camera.main.ScreenPointToRay(evt.position);
if(Physics.Raycast(ray, hit, 50) hit.collider.tag == ("test"))
{
Destroy(Ball); }
if(Physics.Raycast(ray, hit, 50) hit.collider.tag == ("Player"))
{
Destroy(Test);
}
if (Ball Test == Destroy)
{
Application.LoadLevel(0);
}
}
}
}
TIA!