- Home /
Question by
theUndeadEmo · Nov 13, 2011 at 04:08 AM ·
gameobjectarraytag
setting the tag of all gameObjects in an array
my code at the moment
var finishedWaypoints: GameObject[] = GameObject.FindGameObjectsWithTag("Finish"); //.....after some events i want all game objects within this array to have the tag "waypoint" finishedWaypoints.tag="waypoint";
obviously i know the line of code above does not work, need help Thanks
Comment
Best Answer
Answer by syclamoth · Nov 13, 2011 at 04:13 AM
for(var curWayPoint in finishedWaypoints)
{
curWayPoint.tag = "waypoint";
}
There you go! For loops are wonderful.
Your answer
Follow this Question
Related Questions
How to create an array of Game Objects with different tags. 1 Answer
View an array of the transform position/rotation of all game objects with a specified tag., 0 Answers
how do i create a game object array with gameobjects of multiple tags 1 Answer
Need a Custom array Index to look up gameobject tags? 2 Answers
Array Question Length (C#) 8 Answers