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
}
↧