# Limit Rotation Range 180°

**URL:** <https://forums.unrealengine.com/t/limit-rotation-range-180/453337>\
**Category:** Community & Industry Discussion\
**Tags:** rotation, limitation, unreal-engine, question\
**Created:** [August 4, 2019, 9:46am UTC](https://forums.unrealengine.com/t/limit-rotation-range-180/453337 "2019-08-04T09:46:46Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![linkings](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@linkings](https://forums.unrealengine.com/u/linkings)\
**Post date:** [August 4, 2019, 9:46am UTC](https://forums.unrealengine.com/t/limit-rotation-range-180/453337/1 "2019-08-04T09:46:46Z")

</div>

Rotating movement is randomized and It shoud stay **within** the upper 180°.  
_See Blueprint as a text file._

![284097-gg.gif](https://d3kjluh73b9h9o.cloudfront.net/original/4X/b/0/0/b001ba3d7cfadbc570ff835cb51e85164ac10744.gif)

 ![284093-1.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/9/2/d/92d0031260d79955fe4fdd07042a65f4053dd27c.jpeg)

**—\>\> [LowerNeedle.txt][4] \<\<—**

\*Note it has a Rotating Movement component. (142 around X). \*  
_Any help would be a delight because it’s a very important part of the game._

---

<div class="post-metadata">

**Author:** ![ClockworkOcean](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/clockworkocean/32/1169999_2.png) [@ClockworkOcean](https://forums.unrealengine.com/u/ClockworkOcean)\
**Post date:** [August 4, 2019, 11:25am UTC](https://forums.unrealengine.com/t/limit-rotation-range-180/453337/2 "2019-08-04T11:25:46Z")

</div>

Can you show / tell us more about the rotating movement variable? All this code does is randomly multiply it by -1 sometimes…

---

<div class="post-metadata">

**Author:** ![linkings](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@linkings](https://forums.unrealengine.com/u/linkings)\
**Post date:** [August 4, 2019, 11:45am UTC](https://forums.unrealengine.com/t/limit-rotation-range-180/453337/3 "2019-08-04T11:45:07Z")

</div>

Sure! It is kept simple. Auto-activate enabled and its rate is set to 142 around the X axis. So it’s an actor, a gauge needle, which I have rotated against a wall.

![284099-rot.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/b/a/7/ba7761a67606454af43b4b70f50d856ff20eede0.jpeg)

---

<div class="post-metadata">

**Author:** ![ClockworkOcean](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/clockworkocean/32/1169999_2.png) [@ClockworkOcean](https://forums.unrealengine.com/u/ClockworkOcean)\
**Post date:** [August 4, 2019, 11:51am UTC](https://forums.unrealengine.com/t/limit-rotation-range-180/453337/4 "2019-08-04T11:51:13Z")

</div>

Ok, thanks for that, but where’s the code that changes the actor rotation?..

---

<div class="post-metadata">

**Author:** ![linkings](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@linkings](https://forums.unrealengine.com/u/linkings)\
**Post date:** [August 4, 2019, 11:56am UTC](https://forums.unrealengine.com/t/limit-rotation-range-180/453337/5 "2019-08-04T11:56:07Z")

</div>

See red rectangles. If you copy and paste the .txt, the missing things are just the RotatingMovementComponent.

[LowerNeedle.txt][1]

 ![284112-saved.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/e/9/2/e92786c208f4a5e736aea7e6fd807dbde83145aa.jpeg)

---

<div class="post-metadata">

**Author:** ![ClockworkOcean](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/clockworkocean/32/1169999_2.png) [@ClockworkOcean](https://forums.unrealengine.com/u/ClockworkOcean)\
**Post date:** [August 4, 2019, 12:00pm UTC](https://forums.unrealengine.com/t/limit-rotation-range-180/453337/6 "2019-08-04T12:00:16Z")

</div>

Yes, I see the code, but this will not rotate a component. Is the needle a component in the BP?

---

<div class="post-metadata">

**Author:** ![linkings](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@linkings](https://forums.unrealengine.com/u/linkings)\
**Post date:** [August 4, 2019, 12:02pm UTC](https://forums.unrealengine.com/t/limit-rotation-range-180/453337/7 "2019-08-04T12:02:49Z")

</div>

Oh, indeed it is!

 ![284114-saved.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/d/0/2d093a7ca9c68b108f844033e59ce7e1dcbaf9c7.jpeg)

---

<div class="post-metadata">

**Author:** ![ClockworkOcean](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/clockworkocean/32/1169999_2.png) [@ClockworkOcean](https://forums.unrealengine.com/u/ClockworkOcean)\
**Post date:** [August 4, 2019, 12:10pm UTC](https://forums.unrealengine.com/t/limit-rotation-range-180/453337/8 "2019-08-04T12:10:51Z")

</div>

Ok, we’re getting there. What are trying to achieve? Just the needle jumping to random locations?

---

<div class="post-metadata">

**Author:** ![linkings](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@linkings](https://forums.unrealengine.com/u/linkings)\
**Post date:** [August 4, 2019, 12:26pm UTC](https://forums.unrealengine.com/t/limit-rotation-range-180/453337/9 "2019-08-04T12:26:28Z")

</div>

Absolutely, iIt should look like it’s thinking by itself, based on a psychedelic experience I had where I saw a very alien clockwork that looked like:

![284001-download-3.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/9/a/4/9a450de8332122159d090163b3e7de47427f78dd.jpeg)

Imagine the whole thing tightly “working” together. Between the green and red bar, there’s another needle going straight up, which pokes the upper ring. At each poke, three words from the upper ring bind together and get steadily shot out of the top. The words should stay horizontal and not rotate with its bottom to the ring.

![284116-needle.gif](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/9/a/79a567aed37c2a1309d3a2364ce3703fd56af294.gif)

I have placed TextRender components as ciphers into the upper ring. They should spawn random letters while being out of sight in the top half (ev. Triggerbox)… it would be simply astonishing to recreate this 1:1.

---

<div class="post-metadata">

**Author:** ![ClockworkOcean](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/clockworkocean/32/1169999_2.png) [@ClockworkOcean](https://forums.unrealengine.com/u/ClockworkOcean)\
**Post date:** [August 4, 2019, 12:37pm UTC](https://forums.unrealengine.com/t/limit-rotation-range-180/453337/10 "2019-08-04T12:37:50Z")

</div>

Ok!.. 🙂 I’m with you. I never use the rotating movement component. I think you have your work cut out for you if you want to limit that to 180 because it’s constanly moving based on time and you have to try and jump in and try to figure out when to negate the rotation.

I think it would be much easier to just set the rotation of the needle using SetRelativeRotation.

Will get back shortly with an example…

---

<div class="post-metadata">

**Author:** ![ClockworkOcean](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/clockworkocean/32/1169999_2.png) [@ClockworkOcean](https://forums.unrealengine.com/u/ClockworkOcean)\
**Post date:** [August 4, 2019, 12:56pm UTC](https://forums.unrealengine.com/t/limit-rotation-range-180/453337/11 "2019-08-04T12:56:53Z")

</div>

Here you go:

![284109-arrow.gif](https://d3kjluh73b9h9o.cloudfront.net/original/4X/e/d/9/ed92aee4306c95219bfdd0f6230fd508aa24ef3c.gif)

BP is like this:

 ![284108-arrowbp.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/e/9/2/e9223dcd7ef7f78cee0afff5400c0be3898fecfa.jpeg)

So, you get rid of the rotating movement component and just handle the arrow directly 🙂

---

<div class="post-metadata">

**Author:** ![linkings](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@linkings](https://forums.unrealengine.com/u/linkings)\
**Post date:** [August 4, 2019, 1:07pm UTC](https://forums.unrealengine.com/t/limit-rotation-range-180/453337/12 "2019-08-04T13:07:11Z")

</div>

What is this node called and where do I drag it out?

![284117-relra.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/0/2/2/0227167739bb60b497946211f1440e501afaf5ef.jpeg)

---

<div class="post-metadata">

**Author:** ![ClockworkOcean](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/clockworkocean/32/1169999_2.png) [@ClockworkOcean](https://forums.unrealengine.com/u/ClockworkOcean)\
**Post date:** [August 4, 2019, 1:15pm UTC](https://forums.unrealengine.com/t/limit-rotation-range-180/453337/13 "2019-08-04T13:15:30Z")

</div>

SetRelativeRotation

---

<div class="post-metadata">

**Author:** ![ClockworkOcean](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/clockworkocean/32/1169999_2.png) [@ClockworkOcean](https://forums.unrealengine.com/u/ClockworkOcean)\
**Post date:** [August 4, 2019, 1:15pm UTC](https://forums.unrealengine.com/t/limit-rotation-range-180/453337/14 "2019-08-04T13:15:49Z")

</div>

( you drag it from your arrow component )

---

<div class="post-metadata">

**Author:** ![linkings](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@linkings](https://forums.unrealengine.com/u/linkings)\
**Post date:** [August 4, 2019, 1:20pm UTC](https://forums.unrealengine.com/t/limit-rotation-range-180/453337/15 "2019-08-04T13:20:29Z")

</div>

Getting only this:

 ![284122-stra.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/0/b/4/0b4b32fd8e38cba029cd69c2382d1614f1dbbbcd.jpeg)

---

<div class="post-metadata">

**Author:** ![ClockworkOcean](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/clockworkocean/32/1169999_2.png) [@ClockworkOcean](https://forums.unrealengine.com/u/ClockworkOcean)\
**Post date:** [August 4, 2019, 1:22pm UTC](https://forums.unrealengine.com/t/limit-rotation-range-180/453337/16 "2019-08-04T13:22:56Z")

</div>

That’s ok, just different kind of component. Just right click the purple ‘new rotation’ pin and you can split in into 3, then you can connect the float 😃

---

<div class="post-metadata">

**Author:** ![ClockworkOcean](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/clockworkocean/32/1169999_2.png) [@ClockworkOcean](https://forums.unrealengine.com/u/ClockworkOcean)\
**Post date:** [August 4, 2019, 1:24pm UTC](https://forums.unrealengine.com/t/limit-rotation-range-180/453337/17 "2019-08-04T13:24:04Z")

</div>

Oh, sorry, for the current rotation, pull the pin and look for GetRelativeRotation

---

<div class="post-metadata">

**Author:** ![linkings](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@linkings](https://forums.unrealengine.com/u/linkings)\
**Post date:** [August 4, 2019, 1:30pm UTC](https://forums.unrealengine.com/t/limit-rotation-range-180/453337/18 "2019-08-04T13:30:08Z")

</div>

Ah, I splitted it now but…?

 ![284123-22e.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/e/f/4/ef4c3d2fcf77c904e62b5951058bd011a9f64580.jpeg)

Yours is way different – could you send me the Blueprint in.txt? 🙂

---

<div class="post-metadata">

**Author:** ![ClockworkOcean](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/clockworkocean/32/1169999_2.png) [@ClockworkOcean](https://forums.unrealengine.com/u/ClockworkOcean)\
**Post date:** [August 4, 2019, 1:31pm UTC](https://forums.unrealengine.com/t/limit-rotation-range-180/453337/19 "2019-08-04T13:31:42Z")

</div>

No, you’ve still got SETrelativerotation, you need GETrelativerotation 🙂

---

<div class="post-metadata">

**Author:** ![linkings](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@linkings](https://forums.unrealengine.com/u/linkings)\
**Post date:** [August 4, 2019, 1:47pm UTC](https://forums.unrealengine.com/t/limit-rotation-range-180/453337/20 "2019-08-04T13:47:53Z")

</div>

Got it! But it’s spinning around the wrong axis and it looks hilarious lol.  
I tried spinning BP and component but it stays the same.

And, any way to make it move more smoothly and less direct jumpy? (Edit: Fixed by lowering Interp speed)

![284124-wra.gif](https://d3kjluh73b9h9o.cloudfront.net/original/4X/b/7/e/b7ef272834f191de1de99498307fad6851b89250.gif)

[Next page](https://forums.unrealengine.com/t/limit-rotation-range-180/453337.md?page=2)
