Branch working only sometimes. Why?

Look in the image below.

Branch is getting triggered sometimes only.

It works at start and stops at random sprite.

I am using sprites inside sphere collision.

In image you can see its not printing yellow or simulating for HexSprite_C5

Its not only with that specific sprite. It happens anywhere.

343922-help.gif

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.

How to do that? please share unreal doc link or video tutorial.

Also It works properly from the Hex Grid blueprint by binding event we discussed earlier here

https://answers.unrealengine.com/questions/1036991/view.html

But not in Sprite blueprint.

Although Timeline animation works better in Sprite blueprint and not in grid blueprint.

I don’t understand why it work sometimes.

Also I am unable find pattern in that. It feels so random.

It’s not the same as before:

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.

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.

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 ComponentGet 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.

Okk Thanks for help