New answers tagged


Solution Try replacing your Component type to a MonoBehavior. Then script.enabled = false will work. Explanation The Component is the base class for anything that can be attached to a gameobject, it is very barebones, and does not support enabling/disabling. The MonoBehavior class inherits all the functionality of Component but adds some extra features. For ...

Top 50 recent answers are included