- Home /
Stop Script Completely. Doesn't Execute Another Line Of Code.
So I've been trying to figure out how to completely stop a script right in it's tracks so that it doesnt execute another line of code. I tried disabling the script, but it always finished up what it was doing. Anyone know anything else I could try?
Answer by tswalk · Jul 11, 2014 at 02:13 AM
you can terminate any method in a script at any point by using "return;"
however, if you have code following it, you'll get a "Warning Unreachable code detected"...
it's a warning, which is annoying so it should be used in a conditional check to see if what is happening deserve an abrupt stop of the script at that point... if it is used in say "Update()...", of course it gets run a lot :)
not sure that's what you're looking for....
Your answer
Follow this Question
Related Questions
Why this code does not execute? 1 Answer
Timer that stops at the end of the game 3 Answers
Having problems with my timer 1 Answer
Teleporter 2 Answers
How to stop accelerometer when my object touches the plane/ground? 1 Answer