- Home /
How to Enable and Disable Prefabs
Fire is really the small flames prefab modified. When I try to disable it like a GameObject I get an error, have fun reading it...
MissingMethodException: UnityEngine.GameObject.SetActiveRecursivly Boo.Lang.Runtime.DynamicDispatching.MethodDispatcherFactory.ProduceExtensionDispatcher () Boo.Lang.Runtime.DynamicDispatching.MethodDispatcherFactory.Create () Boo.Lang.Runtime.RuntimeServices.DoCreateMethodDispatcher (System.Object target, System.Type targetType, System.String name, System.Object[] args) Boo.Lang.Runtime.RuntimeServices.CreateMethodDispatcher (System.Object target, System.String name, System.Object[] args) Boo.Lang.Runtime.RuntimeServices+c_AnonStorey14.<>m_7 () Boo.Lang.Runtime.DynamicDispatching.DispatcherCache.Get (Boo.Lang.Runtime.DynamicDispatching.DispatcherKey key, Boo.Lang.Runtime.DynamicDispatching.DispatcherFactory factory) Boo.Lang.Runtime.RuntimeServices.GetDispatcher (System.Object target, System.String cacheKeyName, System.Type[] cacheKeyTypes, Boo.Lang.Runtime.DynamicDispatching.DispatcherFactory factory) Boo.Lang.Runtime.RuntimeServices.GetDispatcher (System.Object target, System.Object[] args, System.String cacheKeyName, Boo.Lang.Runtime.DynamicDispatching.DispatcherFactory factory) Boo.Lang.Runtime.RuntimeServices.Invoke (System.Object target, System.String name, System.Object[] args) UnityScript.Lang.UnityRuntimeServices.Invoke (System.Object target, System.String name, System.Object[] args, System.Type scriptBaseType) AdvancedAI_vCreeper.Start () (at Assets/Stuffz/Scripts/AdvancedAI_vCreeper.js:27)
//Script
var Fire : GameObject;
function Start () {
Fire.SetActiveRecursivly (false);
}
function Attack ()
{
Fire.SetActiveRecursivly (true);
}
...so what is this supposed to do? what are you trying to do?
You can use Fire.active = false to disable and Fire.active = true for enable.
Is there away for smooth transition with Lerp of crossfade?
Your answer
![](https://koobas.hobune.stream/wayback/20220613120823im_/https://answers.unity.com/themes/thub/images/avi.jpg)