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<Speedy>().enabled = false;
}
else car.GetComponent<Speedy>().enabled = true;
}
}
ifstatement. Check for your mouse click outside Speedy, and activate or deactivate it from there. \$\endgroup\$