Jump to content
🛡️FORUMS ARE IN READ-ONLY MODE Read more... ×
Sign in to follow this  
hambeast

[Noob Question] public variables and nil

Recommended Posts

Hello guys, this is my first post here so please be gentle. I will start by saying that I have googled this question and have not got much results that were useful.

My understanding is that before a variable is initialized its state is "nil". After initialization, the varaible can be empty or have a value.

My question is: if I initialize a public variable, let's say "MyVariable", can I revert it back to a state of nil?

Would this work?

publicVariable "MyVarible";
"MyVariable" = 1;

if(!isnil("MyVariable"))  {
"MyVariable" = nil;
};

Share this post


Link to post
Share on other sites

you dont need "" around your variable when you assign value to it. you probably need to broadcast changes again if you want your variable to be nil in all comps

Share this post


Link to post
Share on other sites
Sign in to follow this  

×