# BP: Airplane rotation; smooth transition between left and right rotation

**URL:** <https://forums.unrealengine.com/t/bp-airplane-rotation-smooth-transition-between-left-and-right-rotation/1527620>\
**Category:** Programming & Scripting\
**Tags:** timeline, unreal-engine, rotate, question, Blueprint\
**Created:** [December 15, 2023, 2:34pm UTC](https://forums.unrealengine.com/t/bp-airplane-rotation-smooth-transition-between-left-and-right-rotation/1527620 "2023-12-15T14:34:24Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Serellyn](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Serellyn](https://forums.unrealengine.com/u/Serellyn)\
**Post date:** [December 15, 2023, 2:34pm UTC](https://forums.unrealengine.com/t/bp-airplane-rotation-smooth-transition-between-left-and-right-rotation/1527620/1 "2023-12-15T14:34:25Z")

</div>

Hello everyone,

I know the title isn’t an ideal description but I have no idea how to put it any clearer in a short manor. So let me explain in a bit more detail what my issue is. I can’t seem to wrap my head around a decent solution.

For clarification, some rules/restriction for what I’m trying to achieve.

- I have an airplane that always needs to fly forward. Think, an endless runner where you always go forward.
- Airplane should be able to go up and down.
- Airplane should be able to go left and right.

**Problem**  
I want the airplane to be controllable by keyboard. When pressing A, I want the airplane to rotate left and then move to the left. When pressing D, the airplane should rotate right and move to the right. When pressing none, the airplane should return to original rotation (so, no rotation).

So far so good, I made a timeline, on pressing A it turns, on release it returns to 0 rotation. I made a second timeline for D, splendid, it works. But here my problem becomes apparent, if the Timeline is not yet finished from A, and I press D, it cancels the first timeline so it rotates to 0 immediately and then starts the new timeline.

I do understand the problem, since the timeline starts at 0. But how do I fix my issue here?

Maybe timeline isn’t the way to go for me or maybe I should be using 1 timeline instead of 2 separate ones? Anyway, I hope you ladies and gentleman can help me get my thoughts on this back on track.

---

<div class="post-metadata">

**Author:** ![Nawrot](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/nawrot/32/618260_2.png) [@Nawrot](https://forums.unrealengine.com/u/Nawrot)\
**Post date:** [December 15, 2023, 2:54pm UTC](https://forums.unrealengine.com/t/bp-airplane-rotation-smooth-transition-between-left-and-right-rotation/1527620/2 "2023-12-15T14:54:35Z")

</div>

I would not use timeline for this. Also split your problem into 2 problems:

- later on you probably want to make levels, follow plane some path etc. So first problem is how to make player pawn follow path
- second problem is how to display plane like it is following that path (or around it).

For first problem:

- create camera that follows path (for now just follow do not make it pan or move to the sides)
- make pawn that is just a ball, steer that ball around path (use spline for it)

For second part:

- calculate (remember in array of transforms or locations) where ball was sec ago and where it is now
- rotate plane to align with those 2 points
- add plane animations like barell rolls etc.

---

<div class="post-metadata">

**Author:** ![antonioaaa2](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@antonioaaa2](https://forums.unrealengine.com/u/antonioaaa2)\
**Post date:** [December 15, 2023, 7:47pm UTC](https://forums.unrealengine.com/t/bp-airplane-rotation-smooth-transition-between-left-and-right-rotation/1527620/3 "2023-12-15T19:47:04Z")

</div>

You can use (Vinterp to) for location and (Rinterp to) for rotation. Look on YouTube for tutorials. For example, when you want to rotate back you need to get your current rotation plugged in current and the final rotation plugged in target.

 ![maxresdefault](https://d3kjluh73b9h9o.cloudfront.net/original/4X/1/8/8/18868dc679785795bcf571474e499dc23a8636af.jpeg)  
for the target

---

<div class="post-metadata">

**Author:** ![Serellyn](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Serellyn](https://forums.unrealengine.com/u/Serellyn)\
**Post date:** [December 17, 2023, 4:06pm UTC](https://forums.unrealengine.com/t/bp-airplane-rotation-smooth-transition-between-left-and-right-rotation/1527620/5 "2023-12-17T16:06:54Z")

</div>

Thank you for your reply. For now it’s not the exact thing I want to go for but it’s a good fallback option.

---

<div class="post-metadata">

**Author:** ![Serellyn](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Serellyn](https://forums.unrealengine.com/u/Serellyn)\
**Post date:** [December 17, 2023, 4:07pm UTC](https://forums.unrealengine.com/t/bp-airplane-rotation-smooth-transition-between-left-and-right-rotation/1527620/6 "2023-12-17T16:07:14Z")

</div>

I will look into this, thank you!

---

<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:** [January 16, 2024, 4:07pm UTC](https://forums.unrealengine.com/t/bp-airplane-rotation-smooth-transition-between-left-and-right-rotation/1527620/7 "2024-01-16T16:07:30Z")

</div>

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