Hey guys,
I’m trying to setup a script that toggles custom depth whilst the player is in 1 of 2 modes: Mode1 or Mode2.
Here’s the basics of what I’m trying to accomplish:
While(Mode1)
{
Draw all players using Custom Depth
}
While(Mode2)
{
Draw only Mode2 players && disable Custom Depth
}
With the logic I have setup so far, I have the players spawning in Mode1 which enables the custom depth, however when the player enters Mode2, custom depth is disabled but when a fresh player spawns, it is still enabled on that player. How would I go about making sure that all other players aren’t rendered with custom depth on the client side? This is what my logic looks like for handling the custom depth toggle:
(Mode2 is the same but the value is set False)
At the moment, these are custom functions inside my PlayerCharacter class, but they’re called from my PlayerController class (so that they can be dealt on a per client basis). When the player enters either mode, the respective logic is executed. But like I mentioned, it only works for all the players at the time of execution. I didn’t want to use a tick event because I would assume GetAllActorsOfClass would be a little expensive each tick. Is there some kind of function I can use for respawning players or something?
Thanks in advance - Chap.