- Home /
Question by
GerardMe · Sep 12, 2015 at 07:14 PM ·
javascripterror messagecycleflamethrowerbce0070
Type could not be resolved because of cycle
I made a simple Javascript flamethrower but I get this error:
Assets/FlameThrower.js(30,9): BCE0070: Definition of 'FlameThrower.ShootShort()' depends on 'FlameThrower.ShootLong()' whose type could not be resolved because of a cycle. Explicitly declare the type of either one to break the cycle.
Does anyone know how to solve it? Below here is my code:
var longShot : boolean = false;
var shortShot : boolean = false;
var particleLong : GameObject;
var particleShort : GameObject;
var damageBoxLong : GameObject;
var damageBoxShort : GameObject;
function Start ()
{
ShootLong();
}
function ShootLong ()
{
particleLong.gameObject.SetActive (true);
damageBoxLong.gameObject.SetActive (true);
particleShort.gameObject.SetActive (false);
damageBoxShort.gameObject.SetActive (false);
yield WaitForSeconds (3);
ShootShort ();
return;
}
function ShootShort(){
particleLong.gameObject.SetActive (false);
damageBoxLong.gameObject.SetActive (false);
particleShort.gameObject.SetActive (true);
damageBoxShort.gameObject.SetActive (true);
yield WaitForSeconds (1);
ShootLong ();
return;
}
Comment
Answer by getyour411 · Sep 12, 2015 at 08:27 PM
http://answers.unity3d.com/questions/298788/bce0070-error-apparently-my-functions-depend-on-ea.html
I don't know UnityScript but you are recursively calling these two.
Your answer
Follow this Question
Related Questions
How to make a Day/Night Cycle? 2 Answers
Setting Scroll View Width GUILayout 1 Answer
How to change a variable in the same script? 3 Answers
has anyone seen this javascript error? 0 Answers
How to fix BCE0022 Error 1 Answer