Alternative to changing pin architecture

Instead of changing the pin architecture, I decided to destroy the parent game object. Might save you a headache of rearranging the pin architecture was giving you trouble:

  void OnTriggerExit(Collider pins)
    {
        if (pins.GetComponentInParent<Pin>())
        {
            Destroy(pins.transform.parent.gameObject);
        }
    }

I placed the OnTriggerExit in pin.cs - works too. then use Destroy (gameobject);

I added in the update for ball and pins this code

if (transform.position.x > 40f || transform.position.x < -30f || transform.position.z >= 3850)
{
    Destroy(gameObject);
}

As soon as these objects gets out of the set parameters (outside the lane ) they are destroyed
I feel I will regret that in the future, I don’t why ? can anyone tell me please !

Privacy & Terms