Disabling Component with Destroy

Instead of
GetComponent<OneOftheComponent>().enabled = false;

is it possible to use this one?
Destroy(GetComponent<OneOftheComponent>());

Hi,

Did you test your idea? Does it work? If so, it’s a solution. :slight_smile:


See also:

1 Like

Yes it is possible. But component will disappear.
If you use enabled = false you can later turn it on.

2 Likes

@Nina It was working great, but I wasn’t sure if I trigger future problems because of the destroy instead of enable / disable :slight_smile:

@111100 I should think that. I appreciate for your answer :+1:t2: :+1:t2:

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms