Quick Question hoping someone could help with. I have multiple scripts that have a direction enum { north,south,east,west} where you set the “initial direction” that the gameobject is facing. Is there anyway I can have a seperate script iterate through that list of scripts and store “initial direction in an array” I’m having trouble initializing the array that stores the “initial direction” this is psuedo code from the multiple scripts containing the direction enum
public enum Direction
{
north, south, east, west
}
public Direction MyDirection;'
Im thinking the code would have to look something like this to access it
private (?dont know what it would be?)[] _initialDirections;
_initialDirections = new (??)[GameObjectsArray.Length];
for(int i=0; i < GameObjectsArray.Length; i++)
{
_initalDirections _= GameObjectsArray*.GetComponent<Script>().MyDirection;*_
}