really would like some help to make this right. i know its probably something easy I just keep running into a blank wall.
first script:
public class route1 : MonoBehaviour {
public bool r1;
void OnMouseDown()
{
if (r1 = true)
{
WR_R1 = true; // line im having troubles with
}
else if (r1 = false)
{
Debug.Log ("wrong play");
}
}
}
Second script:
public class WR_R1 : MonoBehaviour {
void Update(){
iTween.MoveTo(gameObject, iTween.Hash("path", iTweenPath.GetPath("WR_R1"), "time", 9.5));
}
}
Any help or a point into the right direction would be great and very helpful.
If I look at your error message you’re getting and your first script, all I can see is that you’re checking your boolean value in an incorrect way.
Instead of “if (r1 = true)” you should write “if (r1 == true)” or just “if (r1)”.
public bool r1;
void OnMouseDown()
{
if (r1 == true)
{
WR_R1 = true; // line im having troubles with
}
else
{
Debug.Log ("wrong play");
}
}
First you have to reference the script WR_R1, by using GetComponent to a referenced gameobject to which it is attached.
The gameobject can be referenced by Gameobject.Find.
Then if I understand correctly you need to enable the referenced script on the gameobject if it is disabled.
WR_R1.enabled = true;
Is this what you are trying to do ?