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

Simple past, Present perfect Past perfect

Can you tell me which form of the following sentences is the correct one please? Imagine two friends discussing the gym... I was in a good s...