How to: Use the Same Button with 2 Different Functions?

Hey Newguy here, was wondering if anyone knows if I can fix this.It’s supposed to be the same button but when pressed has 2 different action functions.They are:(1)parkour(holding button for 0.5 seconds) and (2)jumping(basic press and release). So here’s what I did following a video by Matt Aspland(he’s awesome!), but it didn’t have the solution to what I wanted. So any advice is greatly appreciated! T4YT!



The Enhanced Input (you’re using a deprecated legacy system) supports this out of the box:

  • tapping the key in under .5s Jumps
  • holding for at least .5s Parkours

The EI is enabled by default these days, consider giving it a go, it dramatically simplifies certain behaviours:

Or have a look at any UE5 template, they’re all using it.

@Everynone Oh I’ve never seen or heard of this before. On UE4 I just enabled the EI Plugin but dont see the node that u mentioned in the op. Btw I havent finished reading the Docs, gone take a while. Thanks again!

You need to create the Input Actions and name them appropriately.

Hey@Everynone ,I tried making a new EI but couldnt find it .Maybe it is not in UE4 or I am looking in the wrong place. All I see are these nodes:

You need to make input actions, and then add them to the context. Have a look at the docs I linked:

Not sure about the state of the plugin under UE4, though.

Hey @Everynone forgive my lateness! Oh yes I had made the IA node but unfortunately they only look like the basic IA nodes, not the advanced looking one in the op. It’s a lot but Im still working on figuring out where I went wrong here and not abandon it and hop over to UE5. Overall, thanks 4 ur time though brodda!

Try:

P & J would trigger Parkour and Jump respectively.

1 Like

Ok I may not understand but Ill try this out lol ty

It does the above.


Wish I could advise on the original script:

But I don’t understand it and there’s some bad juju there. :innocent: Never attempt to pull data out of a non-exec node like that. It will not work the way you think.

@Everynone
Yea I’ll think twice before doin that again, btw
most of the script isn’t visible cause it’s minimized in ‘New Macro2’. It’s a LOT! Lol…it’ll take about 20 pics to showcase everything or maybe I can make a video showcase. I’ll be honest I think it worked initially but it could be because my mesh got a 2h rifle in his arms I’m not sure if that’s what causing the problem of him mounting etc



The script is from here onwards… Im still looking for a way to switch from equipped rifle mode to hand 2 hand mode,cause I believe that can save me a lot of headache, but no dice yet.