# How to roll your character/pawn in the direction it is turning (like a fighter jet)?

**URL:** <https://forums.unrealengine.com/t/how-to-roll-your-character-pawn-in-the-direction-it-is-turning-like-a-fighter-jet/2062565>\
**Category:** Programming & Scripting\
**Tags:** roll, unreal-engine, Spline, rotate, Blueprint, question\
**Created:** [October 11, 2024, 12:37am UTC](https://forums.unrealengine.com/t/how-to-roll-your-character-pawn-in-the-direction-it-is-turning-like-a-fighter-jet/2062565 "2024-10-11T00:37:11Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![khan150](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@khan150](https://forums.unrealengine.com/u/khan150)\
**Post date:** [October 11, 2024, 12:37am UTC](https://forums.unrealengine.com/t/how-to-roll-your-character-pawn-in-the-direction-it-is-turning-like-a-fighter-jet/2062565/1 "2024-10-11T00:37:12Z")

</div>

Hi - I have a character (box for now) that moves along the spline. It rotates in the direction of the spline as well. In this video below, you can see that the hover object can move x & y coordinates when user presses a button and also face in the direction of the spline:

How do I make it so that the hover object slightly rolls in the direction it is turning? like in Star Fox 64. I do not want to use physics because it takes away from the direction i want to go in. Here’s my current BP that makes it follow the spline:

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/f/2/9/f29611d718b1328668acc7afa86a159ffb7e01f2.jpeg)

and this for event tick:

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/c/c/7cc6f53bef5e57fabe0f4d8dbc9e9373b9404fba.jpeg)

I also do not want to roll completely. Maybe 15 degrees only. Thanks!

---

<div class="post-metadata">

**Author:** ![GekkeGeneraal](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@GekkeGeneraal](https://forums.unrealengine.com/u/GekkeGeneraal)\
**Post date:** [October 11, 2024, 6:43am UTC](https://forums.unrealengine.com/t/how-to-roll-your-character-pawn-in-the-direction-it-is-turning-like-a-fighter-jet/2062565/2 "2024-10-11T06:43:51Z")

</div>

You could use the node Make Rotation from Axes and then set the values inside the forward vector. This will rotate the object in the local X axis.

If you make a Lerp from this, you can smoothly rotate the object 🙂

---

<div class="post-metadata">

**Author:** ![khan150](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@khan150](https://forums.unrealengine.com/u/khan150)\
**Post date:** [October 12, 2024, 5:11pm UTC](https://forums.unrealengine.com/t/how-to-roll-your-character-pawn-in-the-direction-it-is-turning-like-a-fighter-jet/2062565/3 "2024-10-12T17:11:44Z")

</div>

I was able to make something work along these lines, but now the new problem is that my object is “stuck” on the previous angle it took even if the spline is straight:

 ![](https://d3kjluh73b9h9o.cloudfront.net/original/4X/d/d/7/dd73646aa041cea279a76c6a61958ebc1e507804.png)  
This is the most I could do by tinkering in the blueprint. Is this the right way? How do I make the rotation to 0 degrees if my spline is straight? Also not sure about that weird spaz out glitch 😃

---

<div class="post-metadata">

**Author:** ![VisAgilis](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/visagilis/32/891043_2.png) [@VisAgilis](https://forums.unrealengine.com/u/VisAgilis)\
**Post date:** [October 12, 2024, 6:30pm UTC](https://forums.unrealengine.com/t/how-to-roll-your-character-pawn-in-the-direction-it-is-turning-like-a-fighter-jet/2062565/4 "2024-10-12T18:30:26Z")

</div>

You can just add leaning as an animation by using additives. Here’s a tutorial:

> **[Build a Third Person Character from Scratch | Course](https://dev.epicgames.com/community/learning/courses/kry/unreal-engine-build-a-third-person-character-from-scratch/5yX/expanding-on-the-animation-blueprint-with-state-machines-and-leaning)**
>
> Using the "Stack O Bot" project to build a third-person character that includes movement, cameras, animations, and a jetpack.

Since you stated that your model’s gonna be a solid vehicle therefore won’t have a body with bones, you can replace the right and left “leaning” animations by the rotated versions of your model. If your model’s gonna have another animation during normal flight, you can add this leaning blend space on top of your normal movement blend space or animation using the Apply Mesh Space Additive node.

Note that you would need to have an animation blueprint in the first place so if you haven’t, watch the previous tutorial which is the #9 of the series before the one I’ve included here.

Hope this helps! 😊

---

<div class="post-metadata">

**Author:** ![khan150](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@khan150](https://forums.unrealengine.com/u/khan150)\
**Post date:** [October 12, 2024, 9:31pm UTC](https://forums.unrealengine.com/t/how-to-roll-your-character-pawn-in-the-direction-it-is-turning-like-a-fighter-jet/2062565/5 "2024-10-12T21:31:42Z")

</div>

hey! I appreciate the response and quite honestly I needed this tutorial as well for animations on my hovercraft, like the tail, flaps, aileron etc so thank you for this. However, I have seemed to figure out the solution just using the same blueprint. If anyone is stuck in similar place as me (no pun intended 🙂 ), you need to figure out the X value from get rotation at spline input key and normalize it. Usually it’s a range from 0 to 1 with 0 being tangent is 0 degrees (and 1 being tangent 360 degrees). In both these cases, what it means is the spline is straight and we have to rotate the ship back to 0 using a bool check. When condition is true, do the finterp to 0.

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/c/c/4/cc45fd0158d11baccc2d606af190e8156401d3e9.jpeg)

---

<div class="post-metadata">

**Author:** ![system](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/1/3/713c9d3f58553f0de89543d76a8a3a2779dc9fa4.png) [@system](https://forums.unrealengine.com/u/system)\
**Post date:** [November 11, 2024, 9:32pm UTC](https://forums.unrealengine.com/t/how-to-roll-your-character-pawn-in-the-direction-it-is-turning-like-a-fighter-jet/2062565/6 "2024-11-11T21:32:08Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
