- Home /
Question by
isthatcaydo · Apr 25, 2021 at 05:49 AM ·
gameobjectarraytagpositioning
View an array of the transform position/rotation of all game objects with a specified tag.,
I am looking to return/view a list of the coordinates (XYZ position) of all spawned GameObjects that share the same tag.
My code is below, is there something that I am not including or overlooking?
public GameObject[] ConeSpawns;
{
{
if (ConeSpawns == null)
ConeSpawns = GameObject.FindGameObjectsWithTag("Cone");
foreach (GameObject spawn in ConeSpawns)
{
Debug.Log(spawn.transform.position);
}
}
}
,
Comment
Your answer
Follow this Question
Related Questions
Need a Custom array Index to look up gameobject tags? 2 Answers
Array Question Length (C#) 8 Answers
setting the tag of all gameObjects in an array 1 Answer
How to create an array of Game Objects with different tags. 1 Answer
how do i create a game object array with gameobjects of multiple tags 1 Answer