- Home /
A do nothing script?
Is there a script that tells unity to do nothing and move on? I am making a script to navigate through multiple levels of menus, so will just a function onmouseup with seperate "if" statements and no "else" statements? Sorry if it is confusing, i couldnt add the actuall script. Thanks.
Answer by spinaljack · May 17, 2010 at 07:09 PM
if you write a simple if statement that returns false the script will do nothing and move on
Answer by equalsequals · May 17, 2010 at 07:07 PM
That is a little confusing. If you are referring to a quick exit-out of a function you can try:
void MaybeDoNothing() { if(needsToDoNothing == true) return; }
That just skips everything after return and leaves the function block entirely.
Hope that helps,
==
Edit:
Similarly, you can use "break;" to exit out of conditional statement blocks as well.
Your answer
![](https://koobas.hobune.stream/wayback/20220613002946im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
[Newbie] Simple Menu script c# 1 Answer
How do I disable a wind zone through script? 2 Answers
How can I disable controls? 1 Answer
How do you create a menu using C# in Unity? 1 Answer
Disabling THIS script from code 1 Answer