Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

double press a key to perform different function than single

I'm sure this has been asked.. and I did search.. but I can't seem to find exactly what I'm looking for.

I'm trying to implement a control in my game whereby when the play is running faster than X then the press of the jump button makes him jump Y high. (thats done). When standing he jumps lower.

However I now want to add something so if the player if running faster than X and hits the jump button 2 or more times quickly, it does a running diving roll animation. I'm pretty sure I know how to set up the diving roll animation in the animBP. I havent yet.. just to get the mechanics working i added the play animation to the char blueprint. I can get the animation to play (obviously it just hangs afterward and isn't rooted yet) but i can only get it to play if i:

create a variable and call it jumpCount set it to plus 1 everytime jump is pressed.. then at the end add a 1 second delay before the branch that if jumpCount is 2 or more.. then play animation otherwise do regular jump

While this works.... the issue is that now theres a 1 second delay for the regular jump.. obv not good. I tried lowering the delay to 0.1, but then its too quick to capture both jump presses.

Any help would be appreciated.


Product Version: Not Selected
more ▼

asked Apr 14 '15 at 11:00 AM in Blueprint Scripting

avatar image

654 39 38 72

avatar image thankstipscom Apr 14 '15 at 02:25 PM

I added the state to the animBP. I figured I'd try and get the animation working right in the mean time. I just have it triggered by speed and a key press.

Am having a couple issues here as well now.

I thought root animation would resolve this but it doesnt. I enabled it in the animation as well as in the BP.

Three things.... First The character still goes through walls during the animation so the collision isn't working during the animation

Second When the player moves the camera, the whole character moves with it, mid animation

Third When the animation finishes, the character warps back to the starting position.... I want the camera to follow him and the player take over from wherever he landed.

Also there's still the how to make the double tap of the jump button work.

I uploaded a small video of whats going on here:

http://thankstips.com/uploads/dive_roll_issues.mp4 RIGHT-click and save if it doesnt play in browser

thanks in advance!

avatar image thankstipscom Apr 14 '15 at 04:41 PM

well I managed to resolve 1-3 ..... i had to remove the root motion stuff from the animation so it runs on the spot. it was easy to do.. but.. wasn't easy figuring out how. (i didnt need the root motion in this case... i prefer it in place rather than lunging out. however I'll need to figure out how to make root motion work in the future)

for anyone looking to do this the process is:

  1. import the animation into Maya

  2. press the grid looking icon in the bottom left side (looks kinda like four squares) to bring up the bottom interface with the animation key points.

  3. click on the HIP bone of the model. (if you cant see the bones theres a joint icon along the lower toolbar above the first interface window near the right end)

  4. back at the bottom with hip selected, click on Translate Y (for forward motion)

  5. you'll see all the keypoints show up in a line thats wavy

  6. highlight all but the first and DELETE

  7. make sure the first one position is 0

  8. Play the animation and see if its now animating like normal but on the spot

  9. Export FBX Yaxis up

Just need to figure out how to double press key now.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

2 answers: sort voted first

If i were you, I would create the jump and dive-roll animations in two sections so that their start section would be the same (like taking a step forward and jumping or diving). Then you can check at the end of the first secrion if the key was pressed again then determine if it will be a jump or dive.

more ▼

answered Apr 14 '15 at 12:30 PM

avatar image

2k 62 24 111

avatar image thankstipscom Apr 14 '15 at 01:18 PM

hmm.. thanks not a bad idea.

but the jump animation for the dive roll is drastically different than the standard jump. I couldnt use the same jump at the start for both. it would look cosmetically bad. The jump dive roll is all in one animation currently and the jump in that one is more of a heads first jump. wouldn't make sense to land that on your feet.

Unless I'm understanding you wrong.

avatar image thankstipscom Apr 15 '15 at 07:45 AM

I did it this way.... try as i might... getting a double click to work was so difficult. The animation still looks a bit wonky..need to blend it better though.

I still recorded the jump presses into a var, added a 04 sec delay at the end of the jump then it resets the jump pressed var....

in the states, I set the dive-roll after the jump with the rules that the jump height is less than or equal to specific value is jumping is true and is moving only forward

thanks for the help.

If theres a simpler way to register double presses... Id still be interested to know. Especially for Gamepad controls where buttons are limited.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

I found a way for my self and come across this thread, I wanted to do a key press up (or down) to allow the user to run (as welll as holding shift, I find double press is more user friendly)

I dont know how costly ticks are, but I found a way of doing it by holding the time that the key was pressed last and only triggered on that key press again (first post, sorry if I'm necoing and old thread, came across it while google in the same thing) .Only my second day trying unreal, I think I'm going to be here a lot

This allows me to detect double key press up and double key press down to run (I also detect hold shift with a different method). To me, this method seems very simply and not costly ????

alt text

background: php (zend & cake)/ ai automation, (neural nets) /java/c++ programmer

... but this is all very new to me, I've probably done it in a costly manner, but I dont think so

untitled.png (166.2 kB)
more ▼

answered Feb 20 '17 at 10:15 PM

avatar image

11 1 1

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question