In one of my levels, I have four actors acting as door switches. The player must activate all of them to open a door.
To activate a door switch the player has to overlap with the door switch and then press the E key. I need to know on which door switch is the player to active it, but to avoid adding dependencies between the player and the door switch, I’m using events.
At this moment, I’m using a hard coded string to identify each door switch. Instead of this string, is it better to use GameplayTags?
So the switch talks to the door? Just use an interface to let the switch do that. You can use an actor reference ( so it’s all modular ), and set it in the level
if you mean should you ID swtiches by GameplayTag i’d say no. Tags are good for generic things, ie Interactable.Switch if you want to ID i assume you mean Interactable.Switch.1 etc which doesnt scale well.
do you even need to ID the switches, can you just have an int on the door and when it reaches 4 it opens?
also i know you said you dont want to hardcode but if its ‘instanced’ ie in the level there is no reason not to, each instance of door can link its own switches