I have a List with all Players in the level. Every Object has a bool called: “ActivePlayer” and not in every Object is “Active Player” set to true. I want to be able to “possess” every object in that list that has it true. so I have an empty wich should always move to the main Player. I would input into the Empty the “selected Object”.
so Now is there a way to switch trough every object in that List with “ActivePlayer” on where it would also loop at the start and the end of that list?
Yes, you can use a list rather than a bool, the bool method would allow for multiple active players, but you can use a list of players and then a player variable that could be set to one from your list.
List<Player> players;
Player activePlayer;
Then you can all the Players to that List, I would do that in the Player script in Start or OnEnable, but check to make sure it hasn’t been added yet, then you can remove it in OnDIsable() or OnDestroy().