hi i’am trying to find a way to halt a script when i click, because i’am making a strategy game and when i click i would like it to travel where i clicked before stopping. any help would be much appreciated!
public void TurnOff()
{
this.enabled = false;
}
If you wanted to turn it back on you would have to do the same thing as turning it off but just reversing the boolean. eg. false > true
example:
if (Input.GetButtonDown("Fire1"))
GetComponent("Follow Camera part 2").enabled = true;
but yours would have been wrong as you put:
if (Input.GetButtonDown("Fire1"))
GetComponent("Follow Camera part 2").false = true;
if you notice you put ‘.false’ instead of enabled.
GetComponent(YourScript).enabled = false;