- Home /
Adding variables to inspector strings
I'm wondering- say I have a situation where I have to build a set of strings in the inspector, so no strings are hard coded- how would I add a variable into this string? I'm thinking something like this- this would be in a field in the inspector for assigning strings- and using the markup of when you'd print() a string. Here, Charname is the name of the player, stored in another script, referenced into this one.
"Do you want me to repeat that, " + Charname + "?"
So is there any way that I can do this in the inspector? I can't hardcode it in- because I know the values in there can change. So, any way to do this?
Answer by Eric5h5 · Sep 05, 2013 at 10:19 PM
Use some kind of token, like "`Do you want me to repeat that, ?`" Then in your code, replace < charname >
with the charName variable.
Your answer
Follow this Question
Related Questions
Custom Construct Arrays in the Editor - can I control the name of the element? 0 Answers
Script with variable number of variables ? 1 Answer
Notes or Bubble Window for Variables in Inspector Giving Help? 3 Answers
Invisible Public Variable in Inspector 5 Answers
Multiline Text wont stay in separate lines after I copy and paste it. 0 Answers