hello i did a little c++ scripting a while ago and i used the method BIND_ACTION (BIND ACTION(InputComponent,“inputname”, IE_Pressed, reference:: function name) back then to bind a input to a function
now the issue is if i try that in the latest build it comes up with a error,
so my question is
is there another way to bind a input to a function. if so could you give me a example please?
thank you
Here’s a very simple example:
InputComponent->BindAction(“Jump”, IE_Pressed, this, &ADefaultCharacter::Jump)
So, it looks like your problem is that you you’re trying to pass InputComponent as a variable, rather than calling BindAction from it.
Sure thing. Just to verify, that’s just an example from my own character. Yours would be something like this:
InputComponent->BindAction(“YourKeyBinding”, IE_event, this, &YourCharacterClass::YourFunction)
ah thanks for writing back… i tried that but it gave no response to the character in game… i believe there is a error from a bit of my code… but at least i know that your example is the correct way to do it thanks