This is a great video, but it gets a little hard to follow, so I'd highly recommend making a copy of your project after the first tutorial, so that you can do this multiple times. You'll want to add a lot of print_strings and debug objects (I suggest putting an arrow at the character's feet), to really understand what is going on. If you're using this with 5.3.2 (or later) you'll need to change all the animations on your ABP_archer (notably turn_left and turn_right) to looping by checking "Loop Animation" in the AnimGraph. For example in: AnimGraph>GroundLocomotion>Turn_Left(state)
Hi, Stephen, thank you so much for this series. For anyone still having issues with the Turning in place, at time 28:16, before setting the Distance Curve, add a "Map Range Clamped" with the following ranges: In Range A: -62 In Range B: 0 Out Range A: -90 Out Range B: 0 It's not a fix, but it solved that issue and thus works for me. Thank you again and keep up the good work.
Besides another awesome tutorial, this tip about using the "key" in print debug is great, never thought of that and debug spamming was really getting on my nerves! thanks!
4:30 Turn In Place Function Start - For Creating Root Yaw Offset Value 17:20 Turning Animations 26:00 Calculate Turning Curves 35:00 Aim Root Yaw Offset
For anyone who wonders how Subtracting Yaw Excess would fix the Root Bone Rotation, here's my understanding: The very first tick when the animation just activates. The Last Distance Curve is 0 cause it uses the default value of Distance Curve and the Set Last Distance Curve excecutes before the Set Distance Curve updates the Distance Curve value to -90. (The following examples are based on turning left and Root Yaw Offset being 90 when the turning animation initiates and remains the same for the rest of the animations) 1. If we don't use the Yaw Excess subtraction. So, the very first frame, the Delta Distance Curve is -90. For example, if you are turning left, the very first frame, the Root Yaw Offset would then be 90-(-90)=180. The second frame, Last Curve Distance is -90, let's assume the Distance Curve being around -89, the Delta Curve value would be somewhat around 1, then the Root Yaw Offset would be like 179. This is why your Root Bone Rotation gets messed up. It still rotates, but the Root Yaw Offset goes from 180 to 90 .You can test it out by setting the default value of Distance Curve at 90, then your first turn will work just fine, your character's root bone rotates normally. But the second time you turn left, the very first frame, the Distance Curve value is 0 (its value becomes 0 at the end of last animation) before it gets updated, so the Last Distance Curve value is 0, then the Root Bone Yaw Offset value becomes 180 all over again. 2. If we use the Yaw Excess subtraction, the very first frame. You still get Delta Distance Curve as -90, the Root Yaw Offset would be 90-(-90)=180. But then, the same frame, you get Yaw Excess 180-90=90, since you subtract Yaw Excess from Root Yaw Offset, the Root Yaw Offset is 180-90=90. Your character stays still the first frame. The second frame goes on with no problem at all and your Root Bone Rotation works just fine. What if the Root Yaw Offset keeps changing? Then you get a little bit more Root Yaw Offet Value (turning left) until you hit the next turn.
@@boomwowsion64 Thanks for your time. So when I move the mouse(yaw) the character only moves in increments of 90 degrees, so I cannot aim properly. Does this make sense?
@@djtc2093 You might need to check the input axis and see if it's outputting the right axis value. It's in the character blueprint if you are using the third person template.
@@boomwowsion64 It does it both on the standard mannequin third person template and my current setup. I've added a rifle so I need the yaw character movement to be instant when moving the mouse however it is delayed and as I said moves in increments. What would I change? As everything is currently standard?
Hey Stephen, love your tutorials. About this one I got a few notes. Not all the values of the Distance curve are being read by the tick function. This seems to be because of the default blending-time of the turning animations & the early transition from the time-remaining ratio. This results in only a partial resetting of the root yaw offset. Also, on the first tick the Last Distance Curve = 0, and the Distance Curve is -90. This results in a Delta of -90, so on the first tick of turning the Root Yaw Offset is 180 when turning left for 90. And when turning right 90 on the first tick of turning the Root Yaw Offset is -180. The other calculations somewhat make up for it. The end result for me with the current set up is: when you turn 90 degrees, the root yaw offset will only turn back for around 60 degrees. So, the turn-in-place setup is not entirely working correctly for me, but still does the job. I was expecting that when I turn 90 degrees, the root yaw offset is also adjusted by 90.
Yep, that's the nature of blending into/out of anims. If you'd like to turn more, you could also edit the curve so that it results in a higher delta as well.
The other calculations somewhat make up for it. LOL I have been trying to figure out exactly how it makes up for it for hours and still couldn't get it. Nice notes tho.
I just figured it out. Fuck, after about 4-5 hours of thinking and testing. Here's how it works. As you said, the very first tick when the animation just activates. The Last Distance Curve is 0 cause it uses the default value of Distance Curve and the Set Last Distance Curve excecutes before the Set Distance Curve updates the Distance Curve value to -90. (The following examples are based on turning left and Root Yaw Offset being 90 when the turning animation initiates and remains the same for the rest of the animations) 1. If we don't use the Yaw Excess subtraction. So, the very first frame, the Delta Distance Curve is -90. For example, if you are turning left, the very first frame, the Root Yaw Offset would then be 90-(-90)=180. The second frame, Last Curve Distance is -90, let's assume the Distance Curve being around -89, the Delta Curve value would be somewhat around 1, then the Root Yaw Offset would be like 179. This is why your Root Bone Rotation gets messed up. It still rotates, but the Root Yaw Offset goes from 180 to 90 .You can test it out by setting the default value of Distance Curve at 90, then your first turn will work just fine, your character's root bone rotates normally. But the second time you turn left, the very first frame, the Distance Curve value is 0 (its value becomes 0 at the end of last animation) before it gets updated, so the Last Distance Curve value is 0, then the Root Bone Yaw Offset value becomes 180 all over again. 2. If we use the Yaw Excess subtraction, the very first frame. You still get Delta Distance Curve as -90, the Root Yaw Offset would be 90-(-90)=180. But then, the same frame, you get Yaw Excess 180-90=90, since you subtract Yaw Excess from Root Yaw Offset, the Root Yaw Offset is 180-90=90. Your character stays still the first frame. The second frame goes on with no problem at all and your Root Bone Rotation works just fine. What if the Root Yaw Offset keeps changing? Then you get a little bit more Root Yaw Offet Value (turning left) until you hit the next turn.
Hey Stephen, when you have a minute see what kind of game I am creating, thanks to these Bow and Arrow series :) I hope you will like it. I've started a couple of days ago, so this is just the beginning, I am going to make it a GOOD ONE ! :D THANKS AGAIN
This one is a bit harsh to follow ! It would have deserved a 5mn blackboard for the maths. This being said, I learnt quite a lot again : thank you very much for your time and effort.
I have been playing around with setting RootYawOffset to Distance Curve divided by Turning Curve. This should get rid of the blending and give back a curve that starts off at -90 and ends up at 0. I am using an absolute value for turning left and regular value for right.
First, Thanks to Stephen for creating this video. You are truly an invaluable asset to the Unreal Engine community. I recently completed your UE5 course, and it was an incredible experience. However, I have a question for all the viewers . Do you truly understand the concepts being presented in this video, or are you simply following the steps to achieve the desired result? I really want to know what am I missing here to understand it ? Math or 3d Animations consepts or what exactly ?
Congratulations on finishing! If you don't understand this video, you may want to find which parts don't make sense and research those points specifically.
For some odd reason, my animation is not quite right when the left/right turn is executed. The animation triggers but the feet do not do the actual animation but more of a foot slide...
Having a problem with Right turn. It'll play the animation once and then start accumulating the negative rotation. As soon as I press forward it'll spin out until it reaches zero. Then I can get 1 right anim, very little rotation applied and accumulation begins again. Left turn works fine, somewhat. It'll rotate, reduce 30 from RYO. When it reaches 90, another play of anim and a reduction of 30ish.
Awesome video! Not sure if you are planning to expand on this controller but I would like to see you cover how to have the character move in that travel animation and then have her bring up the bow and arrow while holding an aim button. Thanks!
Everything is working fine, except when turning left or right, the turning animation keeps looping. I've rewatched this tutorial so many times and I can't seem to find where the problem is
i would like to set this up to only use these animations if were aiming if we arent i wanna have the bow idle down while we run thatd be cool maybe a power metering too like if you hold the button long enough fire full power if let go too soon the arrow doesnt go as far flops sooner thanks for all your help tho with these tutorials my game lloks much better this method than my own way
If you're having trouble following the Root Yaw Excess, this part is only needed because the distance curves in the data are well... stupid. They need to go from 0 to 90 (and minus 90) respectively. 0 because at the start of the turn, your yaw offset is 0 and +/minus 90 to turn left and right respectively. Then you also need to reset the value of LastTurningCurve back to zero, or it will carry over into the next turn (I do this whenever the ABS of lastTurningCurve is higher than the ABS of turning curve). I suggest making your own curves (only a start and an end point are needed if you use smoothing). As a little bit of tech art will save you a ton of programming.
@@DruidMechanicsGameDevelopment Why even use RootYawOffset anyway? You get similar (if not the same) results by turning off "UseControllerRotationYaw" and then rotating the actor to the base aim rotation if it's moving. (just send the rotation from the turn-in-place animations to the actor and have them rotate by that too.) Maybe it's some sort of Network/Multiplayer thing? But then you could just enable "UseControllerRotationYaw" when it's moving? There must be a good reason for jumping through the giant hoop that is RYO if Lyra is using it?
I found a proper fix for the rotation issue (first frame remaining distance mismatch and excess). With the following fix, you won't need to handle "rotation excess" as you will turn exactly the correct amount. I made an example at the end of the comment that may serve as a TL;DR. Note that I'll use the term `remaining rotation` instead of `distance curve` for my explanation. I was inspired by Lyra's starter game animations. They contain a second curve called `TurnYawWeight` which is equal to `1` when turning. 1) Therefore, make sure to create a second curve `TurnYawWeight` on your animation equal to `1` during the turning. As stated in other comments below this video, you may have found out that the `remaining rotation` doesn't start at +/-90 degrees, because the character is transitioning from his old pose to the new animation. With the new curve (`TurnYawWeight`), we'll be able to tell when we are done transitioning from the previous animation. That means we'll rotate the character only when the `TurnYawWeight` curve is equal to one (it will graduately converge to `1` during the transition, starting from `0`). 2) To avoid turning when the rotation animation hasn't started yet (`TurnYawWeight < 1`), we'll keep setting the `previous remaining rotation` equal to the `remaining rotation curve's value`. That will give a delta of `0` -> no turning. 3) When the curve `TurnYawWeight` is equal to `1` we'll know we are allowed to turn. For that, we'll do exactly as instructed in this video: set the `previous remaining rotation` equal to the `current remaining rotation`. We'll get a delta and use it to turn as shown in the video. By doing that we'll turn exactly the amount of rotation given by the animation `rotation's curve` (+/-90 degrees). However, we'll only rotate by the animation's amount of rotation (90 degrees) given the current process. But we'll want to do wider turns (e.g, 135, 180 degrees, ...). We'll easily fix that by calculating a rotation factor which will increase the rotation rate. For instance, if we want to do a 135 turn, we'll apply a rotation factor equal to 1.5 on the rotation delta in order to turn the perfect amount. 4) To compute this rotation factor, we do a `SafeDivide()`: `RootYawOffset` / `RemainingRotation`. Now that we got the factor, we'll only use it if it's greater than `1` -> we multiply `delta rotation` by the factor we just computed (and we set the delta equal to this new value). Don't forget to remove the "excess rotation handling" process shown in the video as we no longer need it. Done! Here's an example: 1-2) The animation is transitioning, `TurnYawWeight` curve is equal to `0.02` -> we don't turn 1-2) `TurnYawWeight` curve is equal to `0.31` -> we don't turn 1-2) `TurnYawWeight` curve is equal to `0.67` -> we don't turn 3) `TurnYawWeight` curve is equal to `1` -> we TURN! 4) `RemainingRotation` is equal to `90`, but the `RootYawOffset is equal to `-108` degrees. We compute a factor of `1.2` 4) Instead of turning let's say `6.4` degrees (rotation's delta) during a tick, we'll turn by `6.4 * 1.2` In the end we rotated `108` degrees as needed. Now, the animation might look a bit off if you turn way more than it's intended to (turning 180 degrees with a 90 degrees animation, you'll get a small foot sliding). In this case you can use different animations to cover a wider range of turning. Hope it helps. Great video as usual, thank you.
Hi there buddy! Great tutorial! Thanks for taking the time to do this. I'm having 2 problems. The first one is that if I keep turning while playing the animation, after the animation finishes my character keeps rotating in its place sliding its feet (the animation only play once basically) The second is that even if my distance curve is from 90 to 0 the turn is about 60 degrees or sometimes even less. Hope someone can give me a hand with this. Thanks everyone!
I think this is tough- he is showing us how to do a specific thing which takes about 1000 steps. You can end up with the same results if you watch carefully, but we're not pausing at any interval to actually understand what's going on or else I bet we could just figure out melee weapons or other similar things ourselves. We'd probably be better off in the long run watching more generic tutorials that cover the basics of x,y, and z, but instead we are drawn to "how to do specific and cool thing" videos such as this.
I cannot figure out why my character turns perfectly to the Right but not the left its like the interp speed is only applying to the right side i have scanned through this video for 4-5 hours and i still cannot figure it out
I have fixed it, the two animations should have the curve from -90 to 0. In my animation on the right I had the curve from 90 to 0 and the one on the left from -90 to 0. Putting the animation curve to the right of - 90 to 0 works without problems
My Archer's Root bone only rotates 60 Degrees while my animation plays the correct 90 Degree turn. Anyone know what could be causing this? I've recreated the blueprint twice each with different characters (The archer show in the video and a seperate manequin) Neither fix the rootbone rotating issue i have.
I've found the solution for the 60 degrees turning and posted a reply in this comment section. Add a map range clamped at time 28:16 before setting the Distance Curve variable. See values in my comment above.
The turning curve is a bit unnecessary, you could have just used a notify at the start of the animation and it would've been more performant as well. Also, instead of relying on the distance curve you could have interpolated the root yaw offset to 0
my Root yaw offset when being set in the false after moving rotation does not seem to snap the actor root bone back to zero, it is also printing as -40 when played, my camera rotates but my character does not, anyone have a solution?
When I create the Turning curve its not registering in the Curve Value, any suggestions?, Ive checked the naming and made sure to make with meta data, but print string always shows 0.
Nevermind lol, If anyones having issues with having your curves registering after creating them, make sure you are opening the animation from the animation graph no the asset browser.
guys, my character, at the slightest turn of the mouse, spins strongly 360 degrees and the closer to the edge of the screen, the faster it spins, what is the reason for this? I tried to do everything according to the guide.
everything solved the problem. I already had a static copy of my character on the map that was just looking at the wall and apparently it was tied to the yaw function too
you have a tutorial breaking bug in this tutorial, and i wasted 3-4 hours trying to implement your solution without success. the turn in place animation is not actually turning the character. which is unfortunate, because its presented in an easy to digest format.
This is a great video, but it gets a little hard to follow, so I'd highly recommend making a copy of your project after the first tutorial, so that you can do this multiple times. You'll want to add a lot of print_strings and debug objects (I suggest putting an arrow at the character's feet), to really understand what is going on.
If you're using this with 5.3.2 (or later) you'll need to change all the animations on your ABP_archer (notably turn_left and turn_right) to looping by checking "Loop Animation" in the AnimGraph.
For example in:
AnimGraph>GroundLocomotion>Turn_Left(state)
Hi, Stephen, thank you so much for this series. For anyone still having issues with the Turning in place, at time 28:16, before setting the Distance Curve, add a "Map Range Clamped" with the following ranges:
In Range A: -62
In Range B: 0
Out Range A: -90
Out Range B: 0
It's not a fix, but it solved that issue and thus works for me. Thank you again and keep up the good work.
Stephen is the best! Got 3 of his courses. We're lucky to have him around!
could you share the link to one of those courses? thanks!
@@virtualnk5825 do you know c++?
@@akzork yup, I code in C++ on a daily basis.
Soon I am publishing my game, and can't wait to start my new game with Bow and Arrow . THANKS STEPHEN ! Looking forward for this Tutorial .
Besides another awesome tutorial, this tip about using the "key" in print debug is great, never thought of that and debug spamming was really getting on my nerves! thanks!
4:30 Turn In Place Function Start - For Creating Root Yaw Offset Value
17:20 Turning Animations
26:00 Calculate Turning Curves
35:00 Aim Root Yaw Offset
For anyone who wonders how Subtracting Yaw Excess would fix the Root Bone Rotation, here's my understanding:
The very first tick when the animation just activates. The Last Distance Curve is 0 cause it uses the default value of Distance Curve and the Set Last Distance Curve excecutes before the Set Distance Curve updates the Distance Curve value to -90. (The following examples are based on turning left and Root Yaw Offset being 90 when the turning animation initiates and remains the same for the rest of the animations)
1. If we don't use the Yaw Excess subtraction. So, the very first frame, the Delta Distance Curve is -90. For example, if you are turning left, the very first frame, the Root Yaw Offset would then be 90-(-90)=180. The second frame, Last Curve Distance is -90, let's assume the Distance Curve being around -89, the Delta Curve value would be somewhat around 1, then the Root Yaw Offset would be like 179. This is why your Root Bone Rotation gets messed up. It still rotates, but the Root Yaw Offset goes from 180 to 90 .You can test it out by setting the default value of Distance Curve at 90, then your first turn will work just fine, your character's root bone rotates normally. But the second time you turn left, the very first frame, the Distance Curve value is 0 (its value becomes 0 at the end of last animation) before it gets updated, so the Last Distance Curve value is 0, then the Root Bone Yaw Offset value becomes 180 all over again.
2. If we use the Yaw Excess subtraction, the very first frame. You still get Delta Distance Curve as -90, the Root Yaw Offset would be 90-(-90)=180. But then, the same frame, you get Yaw Excess 180-90=90, since you subtract Yaw Excess from Root Yaw Offset, the Root Yaw Offset is 180-90=90. Your character stays still the first frame. The second frame goes on with no problem at all and your Root Bone Rotation works just fine.
What if the Root Yaw Offset keeps changing? Then you get a little bit more Root Yaw Offet Value (turning left) until you hit the next turn.
Please help, my character only yaws in increments , even if I set yaw controller rotation. I can't get a constant yaw.
@@djtc2093 Could you be more specific ? I'll see if i can help
@@boomwowsion64 Thanks for your time. So when I move the mouse(yaw) the character only moves in increments of 90 degrees, so I cannot aim properly. Does this make sense?
@@djtc2093 You might need to check the input axis and see if it's outputting the right axis value. It's in the character blueprint if you are using the third person template.
@@boomwowsion64 It does it both on the standard mannequin third person template and my current setup. I've added a rifle so I need the yaw character movement to be instant when moving the mouse however it is delayed and as I said moves in increments. What would I change? As everything is currently standard?
Thanks! These tutorials are really helpful for helping me understand how to create the early stages of my game! Thank you so much!
Enjoying the new TH-cam content! I would love to see some videos on the Gameplay Ability System.
@DruidMechanicsGameDevelopment Thanks for this!, It seems there are many ways to try achieve the same result, but your worked perfect!
Hey Stephen, love your tutorials.
About this one I got a few notes.
Not all the values of the Distance curve are being read by the tick function. This seems to be because of the default blending-time of the turning animations & the early transition from the time-remaining ratio.
This results in only a partial resetting of the root yaw offset.
Also, on the first tick the Last Distance Curve = 0, and the Distance Curve is -90. This results in a Delta of -90, so on the first tick of turning the Root Yaw Offset is 180 when turning left for 90. And when turning right 90 on the first tick of turning the Root Yaw Offset is -180.
The other calculations somewhat make up for it.
The end result for me with the current set up is:
when you turn 90 degrees, the root yaw offset will only turn back for around 60 degrees.
So, the turn-in-place setup is not entirely working correctly for me, but still does the job.
I was expecting that when I turn 90 degrees, the root yaw offset is also adjusted by 90.
Yep, that's the nature of blending into/out of anims. If you'd like to turn more, you could also edit the curve so that it results in a higher delta as well.
The other calculations somewhat make up for it. LOL I have been trying to figure out exactly how it makes up for it for hours and still couldn't get it. Nice notes tho.
I just figured it out. Fuck, after about 4-5 hours of thinking and testing. Here's how it works.
As you said, the very first tick when the animation just activates. The Last Distance Curve is 0 cause it uses the default value of Distance Curve and the Set Last Distance Curve excecutes before the Set Distance Curve updates the Distance Curve value to -90. (The following examples are based on turning left and Root Yaw Offset being 90 when the turning animation initiates and remains the same for the rest of the animations)
1. If we don't use the Yaw Excess subtraction. So, the very first frame, the Delta Distance Curve is -90. For example, if you are turning left, the very first frame, the Root Yaw Offset would then be 90-(-90)=180. The second frame, Last Curve Distance is -90, let's assume the Distance Curve being around -89, the Delta Curve value would be somewhat around 1, then the Root Yaw Offset would be like 179. This is why your Root Bone Rotation gets messed up. It still rotates, but the Root Yaw Offset goes from 180 to 90 .You can test it out by setting the default value of Distance Curve at 90, then your first turn will work just fine, your character's root bone rotates normally. But the second time you turn left, the very first frame, the Distance Curve value is 0 (its value becomes 0 at the end of last animation) before it gets updated, so the Last Distance Curve value is 0, then the Root Bone Yaw Offset value becomes 180 all over again.
2. If we use the Yaw Excess subtraction, the very first frame. You still get Delta Distance Curve as -90, the Root Yaw Offset would be 90-(-90)=180. But then, the same frame, you get Yaw Excess 180-90=90, since you subtract Yaw Excess from Root Yaw Offset, the Root Yaw Offset is 180-90=90. Your character stays still the first frame. The second frame goes on with no problem at all and your Root Bone Rotation works just fine.
What if the Root Yaw Offset keeps changing? Then you get a little bit more Root Yaw Offet Value (turning left) until you hit the next turn.
Good assessment :)
@@DruidMechanicsGameDevelopment Thank you
Hey Stephen, when you have a minute see what kind of game I am creating, thanks to these Bow and Arrow series :) I hope you will like it. I've started a couple of days ago, so this is just the beginning, I am going to make it a GOOD ONE ! :D THANKS AGAIN
Thanks Stephen! Really appreciate the help.
This one is a bit harsh to follow ! It would have deserved a 5mn blackboard for the maths. This being said, I learnt quite a lot again : thank you very much for your time and effort.
I have been playing around with setting RootYawOffset to Distance Curve divided by Turning Curve. This should get rid of the blending and give back a curve that starts off at -90 and ends up at 0. I am using an absolute value for turning left and regular value for right.
First, Thanks to Stephen for creating this video. You are truly an invaluable asset to the Unreal Engine community. I recently completed your UE5 course, and it was an incredible experience.
However, I have a question for all the viewers . Do you truly understand the concepts being presented in this video, or are you simply following the steps to achieve the desired result?
I really want to know what am I missing here to understand it ? Math or 3d Animations consepts or what exactly ?
Congratulations on finishing!
If you don't understand this video, you may want to find which parts don't make sense and research those points specifically.
9:45 Just blew my mind
Great tutorial!!! I would like to see how hit events could be used in this tutorial series. Thx.
For some odd reason, my animation is not quite right when the left/right turn is executed. The animation triggers but the feet do not do the actual animation but more of a foot slide...
Unfortunately I wasn't able to get this to work, Root Yaw Offset stays locked at 90/-90 and never exits the animation as a result.
Having a problem with Right turn. It'll play the animation once and then start accumulating the negative rotation. As soon as I press forward it'll spin out until it reaches zero. Then I can get 1 right anim, very little rotation applied and accumulation begins again.
Left turn works fine, somewhat. It'll rotate, reduce 30 from RYO. When it reaches 90, another play of anim and a reduction of 30ish.
The same thing! Have you solved this problem ?
cool approach, at the end for the compensation couldnt you just use the clamp float node?
Awesome video! Not sure if you are planning to expand on this controller but I would like to see you cover how to have the character move in that travel animation and then have her bring up the bow and arrow while holding an aim button. Thanks!
Everything is working fine, except when turning left or right, the turning animation keeps looping. I've rewatched this tutorial so many times and I can't seem to find where the problem is
check if the right and left animation loop box is not checked if it is uncheck it , hope this helps
Same thing! It's like it stuck on Last Frame. Debug Shows that distance curve is stuck beetween 0.9 and 1
different problem but same, waste of hours trying to debug this speghetti mess
i would like to set this up to only use these animations if were aiming if we arent i wanna have the bow idle down while we run thatd be cool maybe a power metering too like if you hold the button long enough fire full power if let go too soon the arrow doesnt go as far flops sooner thanks for all your help tho with these tutorials my game lloks much better this method than my own way
Excellent tutorial
Awesome tutorial
If you're having trouble following the Root Yaw Excess, this part is only needed because the distance curves in the data are well... stupid. They need to go from 0 to 90 (and minus 90) respectively. 0 because at the start of the turn, your yaw offset is 0 and +/minus 90 to turn left and right respectively.
Then you also need to reset the value of LastTurningCurve back to zero, or it will carry over into the next turn (I do this whenever the ABS of lastTurningCurve is higher than the ABS of turning curve).
I suggest making your own curves (only a start and an end point are needed if you use smoothing). As a little bit of tech art will save you a ton of programming.
Good points!
@@DruidMechanicsGameDevelopment Why even use RootYawOffset anyway? You get similar (if not the same) results by turning off "UseControllerRotationYaw" and then rotating the actor to the base aim rotation if it's moving. (just send the rotation from the turn-in-place animations to the actor and have them rotate by that too.)
Maybe it's some sort of Network/Multiplayer thing? But then you could just enable "UseControllerRotationYaw" when it's moving?
There must be a good reason for jumping through the giant hoop that is RYO if Lyra is using it?
I found a proper fix for the rotation issue (first frame remaining distance mismatch and excess).
With the following fix, you won't need to handle "rotation excess" as you will turn exactly the correct amount.
I made an example at the end of the comment that may serve as a TL;DR.
Note that I'll use the term `remaining rotation` instead of `distance curve` for my explanation.
I was inspired by Lyra's starter game animations. They contain a second curve called `TurnYawWeight` which is equal to `1` when turning.
1) Therefore, make sure to create a second curve `TurnYawWeight` on your animation equal to `1` during the turning.
As stated in other comments below this video, you may have found out that the `remaining rotation` doesn't start at +/-90 degrees, because the character is transitioning from his old pose to the new animation.
With the new curve (`TurnYawWeight`), we'll be able to tell when we are done transitioning from the previous animation. That means we'll rotate the character only when the `TurnYawWeight` curve is equal to one (it will graduately converge to `1` during the transition, starting from `0`).
2) To avoid turning when the rotation animation hasn't started yet (`TurnYawWeight < 1`), we'll keep setting the `previous remaining rotation` equal to the `remaining rotation curve's value`. That will give a delta of `0` -> no turning.
3) When the curve `TurnYawWeight` is equal to `1` we'll know we are allowed to turn. For that, we'll do exactly as instructed in this video: set the `previous remaining rotation` equal to the `current remaining rotation`. We'll get a delta and use it to turn as shown in the video.
By doing that we'll turn exactly the amount of rotation given by the animation `rotation's curve` (+/-90 degrees).
However, we'll only rotate by the animation's amount of rotation (90 degrees) given the current process. But we'll want to do wider turns (e.g, 135, 180 degrees, ...). We'll easily fix that by calculating a rotation factor which will increase the rotation rate. For instance, if we want to do a 135 turn, we'll apply a rotation factor equal to 1.5 on the rotation delta in order to turn the perfect amount.
4) To compute this rotation factor, we do a `SafeDivide()`: `RootYawOffset` / `RemainingRotation`. Now that we got the factor, we'll only use it if it's greater than `1` -> we multiply `delta rotation` by the factor we just computed (and we set the delta equal to this new value).
Don't forget to remove the "excess rotation handling" process shown in the video as we no longer need it.
Done!
Here's an example:
1-2) The animation is transitioning, `TurnYawWeight` curve is equal to `0.02` -> we don't turn
1-2) `TurnYawWeight` curve is equal to `0.31` -> we don't turn
1-2) `TurnYawWeight` curve is equal to `0.67` -> we don't turn
3) `TurnYawWeight` curve is equal to `1` -> we TURN!
4) `RemainingRotation` is equal to `90`, but the `RootYawOffset is equal to `-108` degrees. We compute a factor of `1.2`
4) Instead of turning let's say `6.4` degrees (rotation's delta) during a tick, we'll turn by `6.4 * 1.2`
In the end we rotated `108` degrees as needed.
Now, the animation might look a bit off if you turn way more than it's intended to (turning 180 degrees with a 90 degrees animation, you'll get a small foot sliding). In this case you can use different animations to cover a wider range of turning.
Hope it helps.
Great video as usual, thank you.
Can you please post your working TIP code into blueprintUE, this is still a bit confusing to follow in combination with this tutorial
Very nice tutorial!
Inspiring
Hi there buddy! Great tutorial! Thanks for taking the time to do this.
I'm having 2 problems.
The first one is that if I keep turning while playing the animation, after the animation finishes my character keeps rotating in its place sliding its feet (the animation only play once basically)
The second is that even if my distance curve is from 90 to 0 the turn is about 60 degrees or sometimes even less.
Hope someone can give me a hand with this. Thanks everyone!
nice lecture! Thank you
Well explained, many thanks!
Thank you so much !
My turn right animation wont play at all, when printing the "Turning" curve value it caps at around 0.15... which means the anim wont play, any help??
Here from your course
Amazing
Please help, my character only yaws in increments , even if I set yaw controller rotation.. So frustrating.
Hello, I want it to walk with travel mode animation and aim when pressing the right button. Do you have a chance to show it?
Ah this is awesome, will you also cover melee and other concepts?
It's possible!
@@DruidMechanicsGameDevelopment Thank you!
I think this is tough- he is showing us how to do a specific thing which takes about 1000 steps. You can end up with the same results if you watch carefully, but we're not pausing at any interval to actually understand what's going on or else I bet we could just figure out melee weapons or other similar things ourselves. We'd probably be better off in the long run watching more generic tutorials that cover the basics of x,y, and z, but instead we are drawn to "how to do specific and cool thing" videos such as this.
@@erich_l4644 Well this tutorial is about the specific thing, not the basics of x, y and z
@@DruidMechanicsGameDevelopment and even tho I am left with only a rough understanding I love and appreciate it, you definitely put work into this
It doesn't find function get curve value. What can be reason?
I cannot figure out why my character turns perfectly to the Right but not the left its like the interp speed is only applying to the right side i have scanned through this video for 4-5 hours and i still cannot figure it out
I'm the same as you right now but it happens to me turning left!
I have fixed it, the two animations should have the curve from -90 to 0. In my animation on the right I had the curve from 90 to 0 and the one on the left from -90 to 0. Putting the animation curve to the right of - 90 to 0 works without problems
What can I do if my AnimationSequences for turning don't have a Distance Curve?
same im using another assetes and it doesnt have those curves, did u find a solution?
same im using another assetes and it doesnt have those curves, did u find a solution?
@@ALBIOPASS you can generate a distance curve using animation modifiers. the animation needs root motion though I think
My Archer's Root bone only rotates 60 Degrees while my animation plays the correct 90 Degree turn. Anyone know what could be causing this? I've recreated the blueprint twice each with different characters (The archer show in the video and a seperate manequin) Neither fix the rootbone rotating issue i have.
I've found the solution for the 60 degrees turning and posted a reply in this comment section. Add a map range clamped at time 28:16 before setting the Distance Curve variable. See values in my comment above.
Tnx
The turning curve is a bit unnecessary, you could have just used a notify at the start of the animation and it would've been more performant as well.
Also, instead of relying on the distance curve you could have interpolated the root yaw offset to 0
I've done it that way too.
thank you so much
Also.. print screen key 1 ... I had no idea
Thanks for the tutorial! Has anyone figured out how to properly replicate this?
my Root yaw offset when being set in the false after moving rotation does not seem to snap the actor root bone back to zero, it is also printing as -40 when played, my camera rotates but my character does not, anyone have a solution?
resolved
When I create the Turning curve its not registering in the Curve Value, any suggestions?, Ive checked the naming and made sure to make with meta data, but print string always shows 0.
Nevermind lol,
If anyones having issues with having your curves registering after creating them, make sure you are opening the animation from the animation graph no the asset browser.
guys, my character, at the slightest turn of the mouse, spins strongly 360 degrees and the closer to the edge of the screen, the faster it spins, what is the reason for this? I tried to do everything according to the guide.
everything solved the problem. I already had a static copy of my character on the map that was just looking at the wall and apparently it was tied to the yaw function too
hello and great tutorial i have a problem , so im using diffrent assets and the turn animations doesnt have those curves any help plz ?
You would need to create curves on the animation
I show you how to do that in my Ultimate Shooter Course
@@DruidMechanicsGameDevelopment thank you for taking the time to respond ill take a look at it
what if my animations have root motion and actually turning 90 degree?
now I see it turns double.. 180 and turn back to 90 when animation ends.
I need to apply it after animation finished and not the during animation.... but you know what it is simpler just to download different animation.
ok for my simple game, just clamping offset to 90 good enough.
Every time he says root yaw offset drink
RIP...
Make bow and arrow multiplayer at the last.
How can you replicate the movement on the server?
The CMC is already replicated
A little off topic, but anyone know how to fix the floating animations with Paragon characters?
You can move the pelvis down and add a key.
RootYawOffset
And to think the last video was just the tip of the arrow
you have a tutorial breaking bug in this tutorial, and i wasted 3-4 hours trying to implement your solution without success. the turn in place animation is not actually turning the character. which is unfortunate, because its presented in an easy to digest format.
What error messages are you getting
Amazing