So my project involves a puzzle with four pushable mirrors, which you use to reflect light to a specific location to solve. The “Light” in question is a static mesh, and when the mirror passes through it an On Component Begin Overlap event is triggered and the mirror adds an identical static mesh to itself at a perpendicular angle. When the “Reflection” hits another mirror, the second mirror creates another reflection, and so on and so forth.
The problem starts when I push a mirror out of the light. For some reason, the mirrors won’t stop reflecting. Usually the first one will stop just fine, but the ones after it continue as if their states haven’t changed.
Initially, I was using a On Component End Overlap event to trigger a Destroy Component command to remove the reflection when the mirror leaves the light or a reflection. From what I can tell, End Overlap never triggers on the second mirror, yet always works fine for the first.
The next thing I tried was using a Line Trace to detect the previous mirror, and when it can’t detect the mirror the reflection is destroyed. This only kind of works. The second mirror doesn’t seem to recognize the first has moved until it is pushed away or another object (like the player character) passes through the Line Trace.
I also tried creating a Function that passes an additional boolean variable that would be required to continue reflecting, but I couldn’t figure out how to get it to work.
Lastly, I created a couple Box volumes on either side of the mirrors that use Begin Overlap to do what I was trying to do with End Overlap. This doesn’t work, either, though I imagine this is because the reflection is being destroyed before it can properly trigger Begin Overlap. I can’t really tell.
I’ve been working on this for weeks, and that’s all I could come up with. Is there something I need to be doing to make sure these are working properly, or is there something that could do the job better?