How to make a 360 one way roll?
How can i make my pawn roll 360°? I want to make it roll in one way without going "reverse" like "Interp to" does.
I was trying few things but it has to many bugs and will take like 60+ nodes or more, i just want to ask here if there is a simpler way to do it.
asked Sep 05 '18 at 01:22 AM in Blueprint Scripting
to accomplish a basic roll that allows you to roll from any rotation you just need to lerp from your current rotation to current + or - 360 using a timeline, timer, or tick. below i show a method to do this. the first part of the script is just a little flow control so that the player cant do a constant roll, modify this as you like (maybe use a can roll variable). the next part saves the current roll rotation to a variable so we have a static position to work from later, this keeps the script from creating exponential acceleration due to shrinkage. next in this case i used a timeline to control the lerp alpha basically the change over time. the trickiest part for most people is next, this is where we control the positions for the lerp rotation. for the roll axis we want to go from set point to set point hence the variable, in this case we want to go from the current roll to a value + 360, this could be a value over 360 if needed. for the other axis we want to use the current rotation of the character or pawn so that we dont get weird jumping around. for this we just use the get actor rotation so it sets those to the current value each update. the last thing to do is to actually set the actors rotation.
note that the engine doesnt care if a rotation value is above 360 or below 0 it will work in either case. -90 is the same as 270 but it just gives the roll direction.
answered Sep 08 '18 at 12:57 AM
This is really all you need to do for a basic system. The timeline length determines how much roll is added each time the player wants to "roll".
answered Sep 05 '18 at 07:31 PM
Nebula Games Inc
hey, ich würd sagen dass es schwer ist das hier nachzuvollziehen. Es hat mir am meisten geholfen, sich weiter daran anzustrengen, da es meist bei mehreren Funktionen oft um ein Flüchtigkeitsfehler handelt. So kriegst du die Lösung bestimmt eher raus :)
answered Sep 07 '18 at 11:00 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here