How to add string (text) variable to object?

I’m using the Variable Editor to add default variables to objects inside object editor but I have problem with string variables. If I enter a string (text) value in between “” , the variable return 0 or nothing it because probably the variable is integer.

Anybody could help me with this how to add string variable using the Variable Editor ?



You don’t need to put the quotation marks.

As Mats said, you have to set them without quotes. Anyway, with or without quotes, you should get the string if you use the expression to get string variables. Maybe you are using:



MyObject.VariableString(MyVar) ?

Thank you both :slight_smile:

so there no way to initialize a variable as string? “” this return “”"" and if you put nothing it reutrn “0” and if you put a space it return a string with one space but when you click on the wrench icon it let you even pick the type and is set at default number… programmatically that make no since what so ever… if the default is string than a empty string value you return not string “0” and seeing that this is normal which i don’t see how @Silver-Streak but couldn’t it be allow to at least when you put “” in it, it return a empty string? The solution that was accepted seem to just did conversion.

Hello @lv2lrn4lf ,

Please don’t bump a thread that is multiple years old. Especially not one that’s nearly 8 years old. :smiley:

This thread would have been around GD4. If you have questions on usage around variables or the engine and can’t find one within the past few years, please feel free to make a new thread.

Also please stop @ing moderators or members that aren’t in the original thread. Thank you!