Answers for "unreal engine c++ bind weapon to function with parameters"

C++
0

unreal engine c++ bind weapon to function with parameters

void AChar::UseSlot(int slot)
 {
  ...
 }
 
 template<int Index>
 void AChar::UseSlot()
 {
     UseSlot(Index);
 }
 
 void AChar::SetupPlayerInputComponent(class UInputComponent* InputComp)
 {
     check(InputComp);
 
     InputComp->BindAction("UseSlot1", EInputEvent::IE_Pressed, this, &AChar::UseSlot<1>);
     InputComp->BindAction("UseSlot2", EInputEvent::IE_Pressed, this, &AChar::UseSlot<2>);
 }
Posted by: Guest on October-21-2021

Code answers related to "unreal engine c++ bind weapon to function with parameters"

Browse Popular Code Answers by Language