So I have a random level generator which creates two separate corridors which two players race trough. The corridors are created with premade rooms that I load with Load Level Instance (by Name).
I have some events that I only want to apply to only one players corridors, for example slow-motion that affects enemies, environmental objects etc. The event is sent to the game mode which broadcast that event and then the affected actors check if they belong to the correct corridor. As I can’t figure out a way to tell actors inside a room which corridor they belong to during the generation itself my current plan is this:
- Create a room manager that I put in each room with an array of all the actors in the room
- When ever a room is loaded the manager adds itself to the game mode and get what corridor is currently being loaded
- The manager can the apply the tag to the actors in the room
- Wait until all the managers have been added to the game mode for the first corridor and then repeat for the second
My problem is that I want to make editing the rooms as simple as possible. I don’t want to have to manually add every actor to the managers array. So either the managers would have to get all of the actors in the room without accessing actors from other rooms, or whenever I place an actor in the editor it is automatically added to the managers array.
Looking for any tips on how to solve my issue or suggestions for a more simple solution.
Any advice is much appreciated