Bind a multicast delegate from an actor in a UObject class

Hi guys,

I’m getting the following error when trying to bind a DECLARE_DYNAMIC_MULTICAST_DELEGATE_ThreeParams in a subclass of UObject, i keep getting the following error:


1>E:/PerforceWorkspaces/Unreal Projects/IGotCrabs/Source/IGotCrabs/Private/Classes/IGCPincerBattle.cpp(21): error C2664: 'void TBaseDynamicMulticastDelegate<FWeakObjectPtr,void,AIGCCharacter *,float,float>::__Internal_AddDynamic<UIGCPincerBattle>(UserClass *,void (__cdecl UIGCPincerBattle::* )(AIGCCharacter *,float,float),FName)': cannot convert argument 2 from 'void (__cdecl UIGCPincerBattle::* )(AIGCCharacter *,int,int)' to 'void (__cdecl UIGCPincerBattle::* )(AIGCCharacter *,float,float)'
1>          with
1>          
1>              UserClass=UIGCPincerBattle
1>          ]
1>  E:/PerforceWorkspaces/Unreal Projects/IGotCrabs/Source/IGotCrabs/Private/Classes/IGCPincerBattle.cpp(21): note: Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
1>  E:\Program Files\Epic Games\UE_4.24\Engine\Source\Runtime\Core\Public\Delegates/DelegateSignatureImpl.inl(1205): note: see declaration of 'TBaseDynamicMulticastDelegate<FWeakObjectPtr,void,AIGCCharacter *,float,float>::__Internal_AddDynamic'

I’m binding using the following code:


BattleOpponent->CharacterActionChangedDelegate.AddDynamic(this, &UIGCPincerBattle::PincerBattle);

Any idea what im doing wrong here?

i think you define your delegate signature with two float params but you are binding a function with two int params signature to it, so that the problem !
change int to float must fix your problem or vice versa.

Thanks Anausha… was such a silly oversight on my behalf!