Multiple Event Instances Bug?
OK, here's the situation:
Note: the laser object stores a "laser terminator" variable that tells the laser what object it's ending or reflecting on.
Scenario: Laser object 'hits' (raytraces) a mirror. Some calculations are done, a new laser is spawned.
Note: this new laser's trajectory makes it hit the very edge (non-reflective) of the mirror. Since the mirror doesn't care about that (it's a non-reflective component), it ignores it and does nothing.
This new laser is stored in a map (variable local to the mirror) with the original laser as the key. When the original laser is destroyed, it activates the mirror's "OnLaserHitEnd" event, which does several things:
When a laser is destroyed, it tells it's "LaserTerminator" so by calling the "OnLaserHitEnd" function.
Let's call these lasers Laser0 (original) and Laser1 (reflected). When Laser0 calls the mirror's "OnLaserHitEnd" event, here is what should happen:
Here is what IS happening, which is causing problems down the line:
So it's as though the "OnLaserHitEnd" event, because it has an instance running inside an instance, fails to return to the original value passed it in the "outer" instance (Laser0) and instead continues it's loop with the inner instance's variables.
I have no idea why this is happening. I've run, step-by-step debug multiple times and come to the same conclusion: When the outer instance finishes the inner instance and returns to its flow, it does so with the inner instance's variables. Can anybody help me figure out WHY, and help me stop it from doing this? Thanks!
asked May 16 '17 at 04:17 AM in Blueprint Scripting
Follow this question
Once you sign in you will be able to subscribe for any updates here