0
Not a Bug

Custom event target cannot be read from changing variable in 1.4.0f9

GhostAegis 2 years ago updated 2 years ago 2

Just updated to 1.4.0f9 and I'm noticing an issue where the object that a custom event listens to seems to be assigned on start and then cannot be altered afterward. Specifically, I have a flow graph that listens to a target object in order to detect a number of different custom events that can be sent to the target. Initially it listens to itself (the target reference is stored in an object variable), and then is assigned various other targets during gameplay. 

However, no matter how many changes I make to the target object variable, the custom event seems to only pull the initial value that was in the object variable (itself, in this case). It worked fine in 1.3.

You can see in this picture how the data is mismatched. Note that this is during play, and everything else seems to be working fine. It's just that the custom event is does not seem to realize that the value of targetHitbox has changed from start, and indeed I can see the damage event fire on the target, but this macro does not see it happen.

The super unit only contains a specifically set up Custom Event unit, nothing else. Pulling it out of the super unit does not fix the problem.

Bolt Version:
Unity Version:
Platform(s):
Scripting Backend:
.NET Version (API Compatibility Level):
GOOD, I'M SATISFIED
Satisfaction mark by GhostAegis 2 years ago
Not a Bug

Hi GhostAegis,

That is a by-design change since 1.4.0. It was a real performance hog to check event listeners at every frame. Right now there is no fallback or workaround for this exact behaviour, unfortunately. You would have to change your design so that targetHitbox sends its own Custom Event to your other machines.

Makes sense! I was able to put together a reasonable work-around knowing this. Thanks for the info!