C++ and Blueprint delegates

Hello there, i’ve encountered some weird error and can’t find solution to fix this.

So what i’ve got is:

Actor, that has two functions bind to OnActorBeginTouch and OnActorHit. The functions are BlueprintNativeEvent, so i can easily and fast create different functionality in Blueprints.
Base class implements these functions this way: spawn few other actors of different class and destroy itself.

Now, when i try to override on touch delegate, if i simply add Blueprint event which overrides function and leave it as is, i got desired result - nothing happens. As soon as i try to spawn other actor or anything like that - my native implementation being called, but the Blueprint overridden one - is not. One thing to note, i print debug string to the screen in my native implementation, and in the case described above - string also is not getting print to the screen, looks like native function being called without being called…

Another thing about Blueprint overriding:

I’m spawning actor via my custom function-wrapper, which takes location and rotation as input. So if i specify location by hand - it works fine, no native implementation is called, once i attach Get Actor Location node to the location input pin - it calls native implementation once again.


So there are few screenshots for better undertanding:

Works fine, nothing happens upon touch.


Works fine, projectile being spawned at specified location.


Does not work as expected, native implementation being called(without debug message being print)

Source code for the actor on pastebin:

[Header][4]

[Implementation][5]


Why not fully use blueprints for this since there’s nothing extraordinary in the C++ code?

Wanted to, but i was not able to override static mesh component properties of the blueprinted-actor which is based on another blueprinted-actor, in other words: i had no access to component added via Blueprint.

Sounds like i need to properly remove function bind to delegates, but i can’t find right function for this, tried both constructor and PostInitializeComponents.

Edit: tried BeginPlay, does not change anything.

Forgot to mention, if i directly attach execution pin to these delegates(not my BlueprintNativeEvent functions), i get exactly same results, so it’s obviously that delegate is bind to 2 or even more functions. But why is this happening? Should not BlueprintNativeEvent function be simply overridden by Blueprints?

Found temporal solution to this: simply remove gameplay code-part of touch/hit handling in C++ and implement it in Blueprints.

Still looking for a real fix :slight_smile:

Closing this, since i realized i’ve been doing excess work and it was little bit stupid.