- Home /
Flip an object based on array value in other object
I'm trying to build Othello, I have a board object that has the array, I need it to either Spawn the token or rotate the token based on the value within the array, but I can't figure out how to get it to do so. Ordinarily I could pass the value to the token in standard C# but from what I understand, Unity doesn't let you do this. Help!
Answer by iHaveReturnd · Nov 14, 2012 at 08:10 PM
You could set the other object, the board, to be a variable of the token. I have only used javascript.
var board : GameObject;
Then set that in the inspector.
Then on your token, you can do board.ArrayName[index] and that will return the value of that index of the array. And have the token handle the response.
That wouldn't work if the token wasn't spawned though, but it may help some.
Your answer
Follow this Question
Related Questions
Rotate Camera around Object 2 Answers
rotate an object on the z axis so that it does not exceed 0-45 degrees 0 Answers
Wonky Camera Behaviours 0 Answers
Object is stuttering on rotation 0 Answers
2D runner, need a help 0 Answers