I’ve watched many tutorials and read many threads about dodges and rolls but cannot seem to find any about making an 8 direction roll blend space. Is this even possible? I’ve saw a few comments on some of the vids stating it would have been much easier to make a blend space for the rolls and not using individual pathways for each key. I want to use my left alt key as the combat roll button that together with the direction I’m going by pressing W A S or D translates into a roll animation played. I’ve set that input and done some experimenting but have not had much luck either way (other than laying out 8 roll animations in BS and seeing them work). Just please be patient with me I’m extremely new to UE. I have working crouch and idle/walk/run blend states with animations for my character (not UE mannequin). Any help with this would be greatly appreciated, thanks!
I would properly ask this as a question but do not have enough post karma to be allowed to do so yet.
Blendspaces should be used for constant directional animation (idle/walk/jog/run etc). Action animations … one offs like dives/rolls etc should be done via montage…in a majority of cases. Using montages would also help keep your statemachine(s) cleaner.
Assuming you’re using the character movement component… movement direction is determined by input scale value.
See project settings -> Engine -> Input -> Axis Mappings
When you press W/Up you’re inputting MoveForward = 1.0 … S/Down = -1.0
When you press D/Right you’re inputting MoveRight = 1.0 … A/Left = -1.0
- No input = 0
MoveForward (1), MoveRight (1) = Forward Right
MoveForward (1), MoveRight (-1) = Forward Left
MoveForward (0), MoveRight (1) = Right Strafe
MoveForward (0), MoveRight (-1) = Left Strafe
You can use these values to set a new var (int) as a controlling state for which roll montage you want to play.
Use the Combat Roll input event to trigger, determine roll direction (int value). Reference that value in the anim BP and execute an event for the montage.
There’s more to it if this will be used in multiplayer…replication etc.
If you need more info just let me know.
Actually yes I would like you to help me more on this. I do not know how to use integers properly in this situation as you suggest. I can upload a pic from my character BP of just one roll direction (roll forward) and try to explain to you some problems I have and ask your opinions on it.
I want the dodge roll to happen when I press the left Alt key. The reason I set up a branch after the RollLeftAlt input is because I found if I did not do that it did not trigger properly. Like I would have to hold Alt then press a direction, and that was opposite of what I wanted, I wanted to hold directional keys and simply tap left alt and trigger the event.
After awhile and weighing the options I decided to use LERPS and timelines for the actual movement of the rolls. I originally had another variable not shown here that I used to get my animation working in the animation BP, but here for simplicity sake I’m using just play animation nodes (having trouble with getting montages to play).
You will notice that from the finished pin of the timeline it goes to a delay then to the reset of a do once that acts as a reset or delay to how often you actually can use a dodge roll. The problem with that is…lets say one were to dodge forward then quickly dodge right, it would do so consecutively without the 1.7 second delay recharge time, so then I do not know how to link the delay for dodge right to dodge forward so that there would be like a “global” delay there that all dodge roll directions would be seeing. Any and all help is appreciated thank you!
What class are you using for your character? Pawn or Character? Can you post a shot of your movement inputs … Move forward/back, left/right and mouse pitch/yaw?
I finally got montages to work not sure why it wasn’t.
Starting over here, so can one integer store all the information from the move forward and move right? So I made a variable (integer) and plugged in move forward and move right axis inputs.
Sorry, I’m still new to UE4 and don’t know much of anything especially about integers.
Under project settings - maps and modes - selected game mode - default class. My character BP is just a copy of the default third person character BP that I have made additions too.
Ok So you’re using “Character” as your parent class. I’ll punch out the logic in BP later today when I have a few moments.
Ok thank you.
Here’s what I whipped up. Pretty straightforward approach. There’s two custom functions (BP images included) to help keep everything organized and clean. This is all done in the “Character Blueprint”. Nothing done in the Anim BP.
BP Overview …
Base Variables … (you need to create these)
- Move X (Float) … default 0.0
- Move Y (Float)… default 0.0
- Roll Delay (Float)… default 3.0 // Roll cooldown
- IsRolling? (Boolean)… default 0
Movement Input … Set “Move X” and "Move Y"
Combat Roll (Input Event) …
Can I Roll (Function) …
Logic scope is up to you. This is simply an extended check. Prone and crouch conditions are examples. At a minimum I recommend keeping the “Is Walking”. Velocity check assumes you don’t want to allow rolls unless the player is moving at least n speed.
Combat Roll (Custom Event) …
Set Roll Montage (Function)
Detail Images …
Function Local Variable : Roll Montage (Anim Montage - Object Reference) … LEAVE DEFAULT VALUE UNSET.
All that’s left is for you to create each of the montage rolls ( 8 of them ). And then assign the montage to appropriate “Set Roll Montage” in the logic.
I made sure I noted the direction for each of them to make it easier.
e.g. Forward & Right, Forward & Left etc.
Excellent post, it worked! Thank you very much for helping me!
The only tweaking I had to do was switch around my roll montages there in the 4 quadrants of the set roll montage function and I had it!
All I need to do now is get this working with my timelines and lerps for basic propulsion and I won’t do much more to the dodge roll. I have never been happier with the animations and how they are triggered right now. I hope others out there setting up 8 way / direction dodge rolls also find this post helpful!
You’re very welcome.
FYI you can take the same approach with Blendspaces for general movement. I have an 8-way, 3 speed blendspace (walk, jog, run) that uses the same principles and approach.
I just found an incredibly easy way to add some propulsion to this. From the Exe pins of the individual animation montages I go out to a Launch Character and I right click and add a Get Last Movement Input Vector and from that return a multiply vector by vector set to 1000 and from that output to a add vector and I set Z to 250 (to add a little off the ground boost to kill ground resistance while launching for easier estimated launches) and that output to the launch velocity of my launch character. I actually only had to do that four times for the four main directions (forward, backward, left, right) and I could still launch in the diagonals all but ONE location, backward left. Easy enough to add another to backward left in the backward section. But here is an odd question, when I hit play, I feel that for the first 20 or so seconds there is a window there that I might have a misfire or two, like a launch with no animation, but after a minute or so it feels pretty solid. Any ideas what could cause that?
Update - I deleted a huge graph of timelines and lerps I had in my character BP and it seems to have resolved the small misfiring issue I had above. Everything seems to be working fine at this time!
Remove your “Launch Character” addition from the “Set Montage” function. Add it to the Combat Roll event just before the Play montage node.
Worked like a charm thx! I imagine this is much more efficient also than the way I had it.
The bigger point … “Is Valid” checks if the Roll Montage value is empty/null. If it’s null then no action is taken… like say playing a montage with no animation or perhaps launching a character for no apparent reason.
Only apply action if it passes conditional logic and validation.
I decided to add further game pad functionality to the roll tonight. I wanted to be able to double click a face button and trigger a roll. I found a simple solution in this thread.
Here is a diagram of how I implemented it into this roll.
That seems to work out alright for what I wanted.
The only variable I had to add was an integer and called it “#Presses”
I’m trying to learn. I appreciate you taking the time to help me out!
Moving on, I thought about trying to make holding the the right face button (B Key for Xbox 360 pad) for 1 or so seconds trigger prone. But for some reason I can’t figure it out. The only thing I have saw it do is instantly go prone like my 1 second conditions for the branch do nothing. Any help about what I’m doing wrong here is much appreciated thanks!