How to make a 360 one way roll?

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.

Ach ne, aber finde diesen Fehler und mache es evtl effizienter als was Ich mache.

How did you set the timeline? 0-1 or 0-360 ?

It work, it spins my whole plane but, the problem is that the whole view spins. I was looking only to spin the plane. It also don’t work when i get my mesh and then “SetRelativeRotation” nor it works with “SetWorldRotation”.

the timeline is a 0-1 float value.

as for your camera spinning that could be many settings but the first thing to look at would be what is your camera parented to? if its parented to the mesh then you may need to add in a layer between what comes before the mesh and the mesh itself, basically add a scene component that you camera is parented to and your mesh is parented to. the result is that your camera and mesh are on the same level so to speak. this all may be a moot point after the next section.

now for moving just the mesh instead of the whole actor you need to be working in relative space so that all the movement is in the local space of the actor. if you were to use world space in this case then you would get weird results where the plane would roll forward or at weird angles depending on your world direction. back to what to do though, basically you need to do the same thing but eliminate a few parts like the variable at the start and the adding the variable to 360. instead we need to get the mesh, get the meshes relative rotation, and use that for the lerp pitch and yaw. for the roll we will use the values 0 and 360 (remember this is all relative space so its 0 degrees different from the actors rotation so theres no snapping to worry about).

also note ive been doing all this in the third person character from the template since i dont have your exact setup for cameras and things results may vary.

im assuming that the plane pawn shown in your picture is just a dummy mesh it doesnt actually have anything it renders right. if thats the case you should be good by just targeting the planemesh. though i dont know how it will react with your current movement system though thats a bit outside the scope of the original question.

I have it like this

253100-untitled.png

It’s like this from the start, this is also why the plane moves like it moves :slight_smile:

Fixed it by letting the plane roll in the direction where the mouse is.