How about going out of bounds?

I thought it’d be cool to also restart the level if the rocket went out of bounds.

The way I’ve done it was by checking when the rocket was no longer visible:

    private void OnBecameInvisible()
    {
        ReloadScene();
    }

It worked but not right away (I was flying out of the camera viewport for a little before Reload hit). What would have you done?

1 Like

I guess that in the end, we should have some walls and a ceiling for the level :wink: But yes, nice idea!

Maybe with a big invisible cube (Mesh Renderer disabled), a BoxCollider with Is Trigger enabled and the Bounds tag :thinking:
If Player goes out > Reload Scene. In my Collision script, I wrote this piece of code and it works :blush:

void OnTriggerExit(Collider other)
    {
        if(other.tag == "Bounds")
        {
            ReloadLevel();
        }
    }

Privacy & Terms