I’m quite a beginer in blueprints and struggling with scripting something that is very easy at first glance.
I want to setup an area, by entering which you switch on mulptiple lights and if you leave it - lights switch off.
I created 2 blueprint actor classes: one for lights and one for the trigger.
Inside the lights class I created a function which toggles the visibility.
And in trigger class I call that function for all lights when pawn begins overlapping the trigger and call it once again when pawn ends overlap.
For single player it works fine. But I’m struggling with replication and number of players calculation in the trigger (so it’s not switching off lights when 2nd player enters the trigger and not switching off lights when one of the player leaves the trigger (and it should be switched on until the last player leaves the trigger).
Will be thankful if you could give me help on how to solve this problem. Thanks in advance