# Random rotation between two values

**URL:** <https://forums.unrealengine.com/t/random-rotation-between-two-values/799475>\
**Category:** Programming & Scripting\
**Tags:** unreal-engine, Blueprint, question\
**Created:** [March 22, 2023, 7:01pm UTC](https://forums.unrealengine.com/t/random-rotation-between-two-values/799475 "2023-03-22T19:01:50Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Danieldealmeida](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Danieldealmeida](https://forums.unrealengine.com/u/Danieldealmeida)\
**Post date:** [March 22, 2023, 7:01pm UTC](https://forums.unrealengine.com/t/random-rotation-between-two-values/799475/1 "2023-03-22T19:01:50Z")

</div>

Guys, help me with something, I want this speedometer to keep choosing a random position every 5 seconds between 0 and 2040 and I want it to rotate with a fade and not teleporting, how do I do that?

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

---

<div class="post-metadata">

**Author:** ![EliasWick](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/eliaswick/32/1175208_2.png) [@EliasWick](https://forums.unrealengine.com/u/EliasWick)\
**Post date:** [March 22, 2023, 7:24pm UTC](https://forums.unrealengine.com/t/random-rotation-between-two-values/799475/2 "2023-03-22T19:24:02Z")

</div>

To control and modify the rotation of a physical 3D object, you can use a timeline and a technique called interpolation. The timeline allows you to set up a variable and graph its movement over time, making it a great tool for controlling an actor’s rotation. By generating a random number and interpolating between the current position and the new position, you can achieve a smooth transition between the two positions. The speed of the position shift is determined by the alpha input in the interpolation, which can be controlled using the variable set up through the timeline.

---

<div class="post-metadata">

**Author:** ![SupportiveEntity](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@SupportiveEntity](https://forums.unrealengine.com/u/SupportiveEntity)\
**Post date:** [March 23, 2023, 2:25am UTC](https://forums.unrealengine.com/t/random-rotation-between-two-values/799475/3 "2023-03-23T02:25:36Z")

</div>

Hey there @Danieldealmeida! Clockwork has a great simple rotation interpolation script in this thread:

> [@How to interpolate rotations](https://forums.unrealengine.com/t/how-to-interpolate-rotations/465115/11):
>
> Thank you so much! I’ve finally got it! I just wasn’t able to understand how event tick worked, but that’s clear now. Thanks a lot again slight_smile
