I’m working on a dynamic camera system where each camera is activated by entering a trigger box. When the player exits the box, the camera begins a Sphere Trace (visibility trace) to check if the player is occluded, and I use a Gate to control when tracing is allowed.
Everything works except one major issue: Sphere Trace continues tracing from old cameras even after the Gate is closed. So there is many ghost sphere traces when I see the gate is closed when debug…
When you Begin Overlap you try to close the gate on “self” which is the actor you started overlapping with. Not the one that was previously active.
You need to somehow get a reference to the currently active camera actor to call Close Gate on that.
Probably you just need to store it in the player pawn or controller and make the switch from there: Call an event “Change Camera” and pass the new camera to the controller/pawn and let it disable the old one and activate the new one.
Now it works, but in the opposite way.
When I enter the collision box, it activates the correct camera and starts the trace from that camera. When I exit the box, the trace stops.
What I actually need is the reverse logic: When exiting the box, it should start the new trace and also stop all previous traces, but right now this Blueprint logic only does the opposite and I’m getting confused trying to flip it….