Saturday, January 6, 2018

unity - Cannot turn script back on


I've got an issue. When (Input.GetMouseButtonUp (0), Speedy script is disabled, thus we cannot enable it again from inside the script like shown below. How can we go around this?


public class  Speedy : MonoBehaviour {

GameObject car;

if (speed == good)
{
GameObject car = GameObject.FindWithTag ("Car");


if (Input.GetMouseButtonUp (0))
{
car.GetComponent().enabled = false;
}

else car.GetComponent().enabled = true;
}
}


No comments:

Post a Comment