'__Internal_AddDynamic': is not a member of 'TMulticastDelegate<void>'

getting this error when trying to use in 4.21, looked for a solution for hours but to no avail.

edit-

i found this code works. first i had to find a solution to the lvalue error and then find a completely different alternative method because it still wasnt working. a bit hacky and i hope somebody has a better fix than this.

Wait, what? Where is the problem?
Did you maybe not declare the function you want to be called as a UFUNCTION() in your .h file?

My code was exactly the same as Ben’s. Was getting this error for adddynamic and adduniquedynamic. Was also getting an lvalue-rvalue error before that.

You want to give the macro the address of the function not call it

Tank->OnDeath.AddUniqueDynamic(this, &AITankController::OnTankDeath);

Note the lack of ()

2 Likes

Oh my God… That might be it. I’ll try when I get chance.

edit- actually no, i get the original error TankAIController.cpp(35) : error C2039: ‘__Internal_AddUniqueDynamic’: is not a member of ‘TMulticastDelegate’ when i do that.

Then that sounds like you didn’t use DYNAMIC_MULTICAST_DELEGATE

1 Like

Yeah youre right. I just confused myself trying all those different methods and didnt change it back to dynamic multi cast which it was originally.

Wasted days on this haha… at least i learnt about simple delegates and lambda functions along the way. thanks for the help guys!

1 Like

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms