Quantcast
Channel: Questions in topic: "clone"
Viewing all articles
Browse latest Browse all 508

How can I enable/disable a component of a Clone

$
0
0
So I am working on a game which spawns between 0 and 12 clones of a prefab, what I wanted to do at first was to enable the component on a set amount of those clones but I couldn't figure out how to do that, what I am trying to do at the moment is enable that component if a condition is reached but if I use `gameobject.GetComponent().enabled = true;` it has no effect on the prefab and the component is still disabled. If there is another way of going about this please let me know as I really need to get it working.

Viewing all articles
Browse latest Browse all 508

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>