Solution in the comments, thanks folks.
Hello and thank you to whoever popped in.
I’ve been using unreal for several years and have gotten relatively adept at blueprints but still want to learn C++
Unfortunately I’ve run into a little snag regarding input and am hoping for a get out of jail card here.
From what I can see, there is nothing wrong with this code. I’ve booted up other projects and compared code, even copy pasted it but nevertheless this refuses to work. I tried to see if my problem was includes but even with everything outside of the header file being identical the issue persists. Something tells me something is either going very wrong or I am missing something very obvious.
As you can see below axis binding works but action binding gives a No instance of overloaded function error
These are my includes

and these are an extended set I used while trying to reverse engineer a working script. Even after copying the working scripts code the error persisted.

Thank you to anyone in advance.
The error means that your arguments don’t line up with any of the function definitions, so it’s looking for a function that matches the arguments that you provided (an overload), but it can’t find anything.
For BindAction, the call signature is
bool UInputComponent::BindAction(
const FName ActionName,
const EInputEvent KeyEvent,
UObject* Object,
UFunction* Function
);
Specifically, the first argument expects a string literal (a constant expression that can be evaluated at compile time), so you can’t use the TEXT macro.
Try this:
PlayerInputComponent->BindAction("ZoomIn", IE_Pressed, this, &AGameCharacter::Zoom);
That being said, you might run into trouble later because this method of doing things is deprecated now. I recommend switching over to the enhanced input system instead.
Appreciate the reply but I’ve actually tried that. It still has the error. Thanks for the heads up about the new input system though. I’ll check it out.
did your zoom function has a parameter?
if yes that maybe the case
1 Like
From that error message it looks like you are trying to BindAction() on a function with a parameter. BindAction() expects no parameters.
Axis functions look like these:
virtual void Axis_MoveRight(float value);
virtual void Axis_MoveUp(float value);
virtual void Axis_LookUp(float value);
virtual void Axis_LookRight(float value);
Action functions look like these:
virtual void Action_LeftMouseButtonPressed();
virtual void Action_LeftMouseButtonReleased();
virtual void Action_RightMouseButtonPressed();
virtual void Action_RightMouseButtonReleased();
Thanks to you and Shmoopy1701 that did the trick. I suspected that might be the case before but looking at the axis input implementation made me discard the thought.
Thanks a bunch everyone
1 Like