Hundreds of features to explore
Games made in Construct
Your questions answered
Trusted by schools and universities worldwide
Free education resources to use in the classroom
Students do not need accounts with us
What we believe
We are in this together
World class complete documentation
Official and community submitted guides
Learn and share with other game developers
Upload and play games from the Construct community
Game development stories & opinions
I have a string instance variable in my family of objects that is originally set to "". I want to do something when it's not "". But my condition [variable not equal to ""] returns true even if the string is "" (and it's showing as "" in the debugger). I had similar issues in the past and got around it using the condition [variable > ""] but that's not working this time. Is there a better way to check if a string is an empty string? Should I not be setting it to "" in the beginning?
Thanks
Develop games in your browser. Powerful, performant & highly capable.
Yes, you shouldn't set "" for the initial value for your variable.
Thanks! I made the change and it worked. I also noticed that in the underlying code, setting the initial value to "" results in:
"initialValue": "\"\""
but not setting any initial value results in:
"initialValue": "",
Good to know :)