note: Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or parenthesized function-style cast
C:\Program Files\Epic Games\UE_5.1\Engine\Source\Runtime\Engine\Classes\Components\InputComponent.h(873): note: see declaration of ‘UInputComponent::BindAction’
C:\Unreal\CryptRaider3\Source\CryptRaider\MyPawn.cpp(36): note: while trying to match the argument list ‘(const char [7], EInputEvent, AMyPawn , void (__cdecl AMyPawn:: )(float))’
why I can not have parameters I could use something like this
void AMyCharacter::OnJump(UInputAction* Action, ETriggerState TriggerState)
{
// Check if the action is valid and the trigger state is started
if (Action && TriggerState == ETriggerState::Started)
{
// Call the jump function from the character class
Jump();
}
}
The function that will be bound must have the same parameter as the delegate.
PlayerInputComponent->BindAction is legacy input system. While ETriggerState is Enhanced Input System. Also, ETriggerState seems to be an enum for internal use.
U can use this instead EnhancedInputComponent->BindAction(Jump_Action, ETriggerEvent::Started, this, &AMyCharacter::OnJump
where Jump_Action is UInputAction, u can look at the template project for the example.