Hey everyone, I created this custom event that works together with the Can see enemy boolean, that gets set whenever the enemy sees the player. Ive placed this function in the beginplay event, but Ive run into the issue that it only runs once. The Can see enemy boolean, can eventually be set to false again, if the enemy losts vision of the player, but as soon as the game starts the false branch gets triggered and the true one never gets triggered, how can I loop this event so that the fov keeps changing trought out the game?
boolean, that gets set whenever the enemy sees the player.
Rather than running this on begin play, plug this script into whatever changes the bool, you may not even need that bool then.
But to be honest, this should be dispatched to the player so they can decide themselves how the camera behaves. The approach you have would only work well if there’s one enemy. Otherwise you’d need to constantly track who sees whom. Or keep repeating this check which is inefficient.
Yeah, placing them when the boolean is set worked just fine, thanks. I do have an enemy, the boolean is mainly used so that the enemy chases the player when it sees him, and if it stops seeing the player it stops chasing it. Also dont know if you could help me with this but, Ive also now set up a timeline with a lerp, so that the fov changes smoothly, but currently it makes the transition, the first time its seen and the first time, the enemy looses the player, but afterwards the fov change is the default one that just snaps.