# Stop Movement when player local rotation is NOT between 170\* to 190\* or -170\* to -190\*? node?

**URL:** <https://forums.unrealengine.com/t/stop-movement-when-player-local-rotation-is-not-between-170-to-190-or-170-to-190-node/40076>\
**Category:** Blueprint\
**Tags:** unreal-engine\
**Created:** [August 29, 2015, 4:19am UTC](https://forums.unrealengine.com/t/stop-movement-when-player-local-rotation-is-not-between-170-to-190-or-170-to-190-node/40076 "2015-08-29T04:19:48Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![anonymous\_user\_5632d6bf](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_5632d6bf](https://forums.unrealengine.com/u/anonymous_user_5632d6bf)\
**Post date:** [August 29, 2015, 4:19am UTC](https://forums.unrealengine.com/t/stop-movement-when-player-local-rotation-is-not-between-170-to-190-or-170-to-190-node/40076/1 "2015-08-29T04:19:48Z")

</div>

Hey everyone, I am working on a 2.5D skateboarding game.  
The player moves along the y axis, & can “ollie” (jump) over objects, and rotate locally on Z axis when in air.  
Problem is even if the player lands sideways(not 180\* or -180\*), he can still move.  
How do i go about constraining the movement to when the players local rotation is NOT 180\* or -180\* any other rotation would cause the player to stop, and ignore movement inputs until rotation is aligned 180\*. Does a node exist that gets the rotation of the character, say between 170 and 190 can move?  
I appreciate your time, any ideas no matter how simple or small will help. Just ask for extra info if needed;)  
Thankyou

---

<div class="post-metadata">

**Author:** ![Duwayne](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Duwayne](https://forums.unrealengine.com/u/Duwayne)\
**Post date:** [August 29, 2015, 6:09am UTC](https://forums.unrealengine.com/t/stop-movement-when-player-local-rotation-is-not-between-170-to-190-or-170-to-190-node/40076/2 "2015-08-29T06:09:44Z")

</div>

EDIT:

Here is a solution. modified from below post

[![](https://i.imgur.com/VRuWe3a.png) ](https://i.imgur.com/VRuWe3a.png)

[![](https://i.imgur.com/HJHh9Bc.png) ](https://i.imgur.com/HJHh9Bc.png)

**Orignal post**  
This might be the wrong answer haha, but from recent playing around…

there is a enable input option within blueprint, you might be able to setup a per tick check of y axis and if it is outside of said range it sets input based on a bool?

Here was my thought process. i would say add this to event tick? so its checked every tick? (Fixed Image)

[![](https://i.imgur.com/9QvznVA.png) ](https://i.imgur.com/9QvznVA.png)

EDIT:

Worked exactly as intended!!

[![](https://i.imgur.com/rw8Ob5w.png) ](https://i.imgur.com/rw8Ob5w.png)

[![](https://i.imgur.com/tCAykkV.png) ](https://i.imgur.com/tCAykkV.png)

every frame it checks if the player is faceing with in +/- 5% of straight, you can make it more strict, then im sure the “disable input” would run a get straight / look forward animation then re-enable input?

---

<div class="post-metadata">

**Author:** ![\_cDub](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@\_cDub](https://forums.unrealengine.com/u/_cDub)\
**Post date:** [August 29, 2015, 7:51pm UTC](https://forums.unrealengine.com/t/stop-movement-when-player-local-rotation-is-not-between-170-to-190-or-170-to-190-node/40076/3 "2015-08-29T19:51:46Z")

</div>

The only problem I see with this is that if input is enabled, it may be possible that you are continuously enabling input. You may want to check to see if input isn’t enabled before trying to enable it. It might not have to much of an effect on performance or anything, but I personally try not to let things like that happen.

---

<div class="post-metadata">

**Author:** ![Duwayne](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Duwayne](https://forums.unrealengine.com/u/Duwayne)\
**Post date:** [August 29, 2015, 8:55pm UTC](https://forums.unrealengine.com/t/stop-movement-when-player-local-rotation-is-not-between-170-to-190-or-170-to-190-node/40076/4 "2015-08-29T20:55:01Z")

</div>

I completely agree with \_cDub for game implementation, i would go something like this for easy long term control / non clutter

It only enables / disables input if it is already disabled/enabled. so the enable / disable input isn’t spammed.

[![](https://i.imgur.com/VRuWe3a.png) ](https://i.imgur.com/VRuWe3a.png)

[![](https://i.imgur.com/HJHh9Bc.png) ](https://i.imgur.com/HJHh9Bc.png)
