If you're using the default collider setup that comes with the ships:

If you are still using the default collider setup that the ships come with, with an empty game object called Colliders with children empties all with box colliders, so like this: image

You can use this code to disable all of the colliders:

        var colliders = GetComponentsInChildren<Collider>();
        foreach (var collider in colliders)
        {
            collider.enabled = false;
        }

You put this in after disabling the player controls. Hope this is useful for you!

4 Likes

Thanks for sharing this great tip :slight_smile:

1 Like

Good tip. I went the other way and used:

GameObject.Find("Collider").SetActive(false);

to turn the whole component off.

1 Like

and I did something entirely differerent, and set this.transform.localscale = Vector3.zero to disappear the ship during the explosion - cheap and fast :slight_smile:

Privacy & Terms