Quantcast
Channel: Questions in topic: "error"
Viewing all articles
Browse latest Browse all 7934

script switching gives error

$
0
0
i have two scripts, the main script which is the **"playerscript"** and the second script which is the **"actionScript"**. I have tried different methods of switching but they don't work maybe i'm doing something wrong. this is the current error i am getting **Assets/myScripts/modeScript.js(17,21): BCE0031: Language feature not implemented: Ambiguous(playerscript.enabled, UnityEngine.Behaviour.enabled).** var mainScript:playerscript;// for playerScript var fightScript:actionScript;// for fightScript var lwCharge:lonewolf;// calls the lonewolf script // i already did the drag and drop method and it works function Start () { // the getComponents will be here mainScript=GetComponent("playerscript"); fightScript=GetComponent("actionScript"); } function Update () { if(lwCharge.charging==true)// checks if a bool in the lonewolf script is true { Debug.Log("yes"); mainScript.enabled = false; fightScript.enabled = true; } else { mainScript.enabled=true; fightScript.enabled=false; } //it will check if charge is true, if it is it will automatically switch from playerScript to fight script }

Viewing all articles
Browse latest Browse all 7934

Trending Articles



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