[C++] Cannot convert argument 3 from float to void

Hello!

I have been creating WASD-controls with this tutorial A new, community-hosted Unreal Engine Wiki - Announcements - Epic Developer Community Forums

and the following error message appears:
(character name is Puncher)
Error 3 error C2664: ‘FInputAxisBinding &UInputComponent::BindAxis(const FName,UserClass ,void (__cdecl APuncher:: )(Param1Type))’ : cannot convert argument 3 from ‘float (__cdecl APuncher::* )(float)’ to ‘void (__cdecl APuncher::* )(Param1Type)’ C:\Users[CENCORED]\Documents\Unreal Projects\Oakpunch\Source\Oakpunch\Puncher.cpp 24 1 Oakpunch

I assume it could be a missing letter somewhere, but there isn’t those typo lining anywhere but in the voidnames of “MoveRight” and “MoverForward”, + in the “->” of
InputComponent->BindAxis(“MoveForward”, this, &APuncher::MoveForward);
InputComponent->BindAxis(“MoveRight”, this, &APuncher::MoveRight);

I would love to get someone with more knowledge on the subject to share some of it with me, thanks! :slight_smile:

-DoctorPC

It seams your binded function returning float where compiler expect non returning function (void)

How could I solve it?
The declaration is:
UFUNCTION()
float MoveForward(float Val);
(which explains the float) it should be exactly the same to the tutorial…
Thanks!

I have same issue 2 years later.

Duh,

I forgot to declare my functions properly in header file. I did not put the float parameters.

void MoveForward(float Value);
void MoveRight(float Value);