# Rotate an actor by key press

**URL:** <https://forums.unrealengine.com/t/rotate-an-actor-by-key-press/473322>\
**Category:** Character & Animation\
**Tags:** rotation, unreal-engine, Blueprint, question\
**Created:** [October 22, 2020, 5:35pm UTC](https://forums.unrealengine.com/t/rotate-an-actor-by-key-press/473322 "2020-10-22T17:35:42Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![ghimpster](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@ghimpster](https://forums.unrealengine.com/u/ghimpster)\
**Post date:** [October 22, 2020, 5:35pm UTC](https://forums.unrealengine.com/t/rotate-an-actor-by-key-press/473322/1 "2020-10-22T17:35:42Z")

</div>

Hello,

I am trying to rotate an actor by presing a key ("E) in my case. The idea is that I want to rotate it for 45degrees every time I press the key (left or right).  
How the blueprint is now, it allows me to rotate only once for 45 degree. I want to be possible to rotate it 8 times (45 x 8 = 360degree, left or right).

 ![319705-animation.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/a/b/6/ab6cdce1948bdbf1b7d305d9a8e19b0b05635dc6.jpeg)

Would you please let me know what do I need to add to my blueprint to make it so?

Thanks in advance!

---

<div class="post-metadata">

**Author:** ![Everynone](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/everynone/32/1135017_2.png) [@Everynone](https://forums.unrealengine.com/u/Everynone)\
**Post date:** [October 22, 2020, 8:23pm UTC](https://forums.unrealengine.com/t/rotate-an-actor-by-key-press/473322/2 "2020-10-22T20:23:40Z")

</div>

When working with Timelines, it’s super useful to store the initial values first. This way you avoid interpolating twice since you’re sampling the rotation during the Timeline’s update:

 ![319726-screenshot-2020-10-22-212037.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/c/6/c/c6ce01fe01ef3b97d89d2b5a2b1dea715bddb80a.jpeg)

[![Image from Gyazo](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/5/9/75932f5065761407d6500e610462a90ded877325.gif)](https://gyazo.com/e2adebe1e86354995d7d5a6fd81cbcaa)

---

<div class="post-metadata">

**Author:** ![ghimpster](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@ghimpster](https://forums.unrealengine.com/u/ghimpster)\
**Post date:** [October 23, 2020, 6:52am UTC](https://forums.unrealengine.com/t/rotate-an-actor-by-key-press/473322/3 "2020-10-23T06:52:01Z")

</div>

Thank you for your answer!

I’m gonna try it out and see how it goes!

---

<div class="post-metadata">

**Author:** ![ghimpster](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@ghimpster](https://forums.unrealengine.com/u/ghimpster)\
**Post date:** [October 24, 2020, 5:46pm UTC](https://forums.unrealengine.com/t/rotate-an-actor-by-key-press/473322/4 "2020-10-24T17:46:51Z")

</div>

Thank you again. It works perfectly, and I like the conidition you add there to not be able to spam 🙂 the action.  
To continue this, I would like to limit the rotation to 4 times on both ways (for this case). Is there any script that can do this?

Cheers!

---

<div class="post-metadata">

**Author:** ![Everynone](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/everynone/32/1135017_2.png) [@Everynone](https://forums.unrealengine.com/u/Everynone)\
**Post date:** [October 25, 2020, 10:15am UTC](https://forums.unrealengine.com/t/rotate-an-actor-by-key-press/473322/5 "2020-10-25T10:15:10Z")

</div>

The easiest ways being usually the best, I’d probably just count the turns:

 ![320010-screenshot-2020-10-25-101840.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/c/e/b/ceb42d7f8b8595e183387ae7d32502c8b33e5854.jpeg)

---

<div class="post-metadata">

**Author:** ![jonsrnangerang](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@jonsrnangerang](https://forums.unrealengine.com/u/jonsrnangerang)\
**Post date:** [October 25, 2020, 11:08am UTC](https://forums.unrealengine.com/t/rotate-an-actor-by-key-press/473322/6 "2020-10-25T11:08:28Z")

</div>

> **[Swalife Login ❤️](https://swalife.site)**
>
> SWA ID | Login | Retiree Login

---

<div class="post-metadata">

**Author:** ![jonsrnangerang](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@jonsrnangerang](https://forums.unrealengine.com/u/jonsrnangerang)\
**Post date:** [October 25, 2020, 11:08am UTC](https://forums.unrealengine.com/t/rotate-an-actor-by-key-press/473322/7 "2020-10-25T11:08:41Z")

</div>

> **[Swalife Login ❤️](https://swalife.site)**
>
> SWA ID | Login | Retiree Login

---

<div class="post-metadata">

**Author:** ![jonsrnangerang](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@jonsrnangerang](https://forums.unrealengine.com/u/jonsrnangerang)\
**Post date:** [October 25, 2020, 11:09am UTC](https://forums.unrealengine.com/t/rotate-an-actor-by-key-press/473322/8 "2020-10-25T11:09:47Z")

</div>

> **[Oklahoma Natural Gas Login - ONG Bill Payment, Customer Care Number](https://oklahoma-naturalgas.site)**
>
> Oklahoma Natural Gas Login, ONG Bill Payment, Tariffs, Customer Care Number, Oklahoma natural gas bill payment online website login ong login ong bill pay.

[https://ez-pass.info/](https://ez-pass.info/)  
[https://myvanilladebitcard.site/](https://myvanilladebitcard.site/)

---

<div class="post-metadata">

**Author:** ![ghimpster](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@ghimpster](https://forums.unrealengine.com/u/ghimpster)\
**Post date:** [October 26, 2020, 8:21am UTC](https://forums.unrealengine.com/t/rotate-an-actor-by-key-press/473322/9 "2020-10-26T08:21:58Z")

</div>

Awesome like before!  
Thx a lot again.  
I see that this kind of things looks pretty easy for someone who knows…still a long way for me there! But I’m getting better :).

Cheers!
