Kettenotter / KettisLogicDriverExtension

Some utility functions for the Logic Driver Unreal Engine Plugin
5 stars 0 forks source link

Transition on gameplay event only works for the first time #1

Closed cosmicnag closed 5 months ago

cosmicnag commented 5 months ago

I have astate transitions between two states (well, a state and a state machine reference) on two different GTags (to and fro). It takes transition once, then back, but doesnt take the same transition again. For the second time,debugger last hits the send gameplay event code (from my code), but doesnt even hit CanEnterTransition in the plugin code below (and generally no state transition takes place).

Also, had to change the following function to return true, as super call seems to be returning false.

https://github.com/Kettenotter/KettisLogicDriverExtension/blob/9930f22fc6cfaa48f6c2d013a536a04da65251aa/Source/KettisLogicDriverGAS/Private/TransitionGameplayAbilityGeneric.cpp#L39

Kettenotter commented 5 months ago

Okay it looks like I forgot to reset the handle. Like removing the delegate doesn't reset the handle by itself.

The second time the transition was entered the handle was still valid even though it was not and so no delegate was bound.

Could you see if this fixed it for you? (I also made the Can enter transition return true)

Just keep in mind that the Call to the event needs to happen after the transition was bound. (But I am thinking about a lazy version which still transition if the event was called one or two frames earlier)

I also reduced the memory size on the GameplayEventCachedData

cosmicnag commented 5 months ago

The handle reset indeed resolves the issue. Also, thanks for the optimizations in the cached version. Looking forward to the lazy version and any other improvements. Closing the issue.