system
1
Hey, I've been searching around to find an example of what I'm looking for, but with no avail.
What I want to do is name a variable out of characters or using a string like this:
transform stuffA;
transform stuffB;
void Start () {
Do("A");
}
void Do (string test) {
stuffB = "stuff" + test;
}
Of course, the above doesn't work. The console tells me that it can't convert 'char' to a transform.
I've seen some stuff about Hash tables, but I'm unsure how to use them for this.
Thanks
-AJ
DaveA
2
This depends on what you want Do to do. If you had a game object named stuffB you could GameObject.Find it like that. Otherwise, look into 'eval'