When i write something like:
{gameObject.myName} or {NameTest.myName}
then
FormattingException: Error parsing format string: Could not evaluate the selector “gameObject” at 13
My name is {gameObject.myName}
How can I get the variable myName?
When i write something like:
{gameObject.myName} or {NameTest.myName}
then
FormattingException: Error parsing format string: Could not evaluate the selector “gameObject” at 13
My name is {gameObject.myName}
How can I get the variable myName?
Did you drag in the script? You need to drag a reference to the component. Make sure its the component and not the GameObject.
Can you try doing {myName.GetType}
If it doesn say NameTest then you dragged in the wrong object.
oh I see the problem.
You need to do {myName.myName}
The 1st call gets the object reference and the 2nd will extract the field value.
You probably want to rename the local variable to something else so its less confusing.
Thank you very much!
I’m just still learning