The Event pins do not retain values for long. This script is unstable and should not work properly in most situations - I would expect this to start throwing serious errors eventually.
Store references, promote those pins to vars and use those vars, checking whether they’re valid before you perform any ops.
You’re comparing pins of 2 Events. But you can never be sure whether the data is not stale so you need to be crateful. When the bottom event executes, the actors and components the pins of the upper event referenced may no longer be valid, those entities may not even exist.
please share unreal doc link or video
tutorial
This is not UE4 specific, this is general [OOP][2] programming.
And it’s happening here as well. You’re dragging the wire of Touched Component someplace. While this may work fine in some scenarios, there is no guarantee that it will work when you try to access it later on. Especially that the timeline (like Delay) is a latent action.
Imagine what happens if the Touched components gets destroyed / becomes invalidated while the timeline plays.
These are nightmarish bugs to track, intermittent and will seem random in nature.
edit: screenshot got updated so my comment above is probably irrelevant
Ultimately I am trying to do this
later on. But It doesn’t subtract
those two vectors. It simply prints
Touch Enter Actor world location.
Touch Begin Actor or Touched Component?
You may still be getting stale data as you try to access the pin data (Touched Component → Get World Location) after the Timeline has finished. Once the events pump the data in the variables, use those variables only instead of the event pins.
And it would not hurt to check if they’re still valid. Unless you’re 100% certain they’re valid, ofc.