# Disabling and enabling player movement and rotation on button press

**URL:** <https://forums.unrealengine.com/t/disabling-and-enabling-player-movement-and-rotation-on-button-press/37743>\
**Category:** Blueprint\
**Tags:** unreal-engine\
**Created:** [August 6, 2015, 1:19pm UTC](https://forums.unrealengine.com/t/disabling-and-enabling-player-movement-and-rotation-on-button-press/37743 "2015-08-06T13:19:04Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![anonymous\_user\_9678a9dd](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_9678a9dd](https://forums.unrealengine.com/u/anonymous_user_9678a9dd)\
**Post date:** [August 6, 2015, 1:19pm UTC](https://forums.unrealengine.com/t/disabling-and-enabling-player-movement-and-rotation-on-button-press/37743/1 "2015-08-06T13:19:04Z")

</div>

Hello,

I am trying to create an in-game model viewer. Right now I have the ability to click on a Physics Object and have it appear in front of the character and when Spacebar is pressed, the object goes back to its original position and rotation. The problem I’m having is that the player can still move around with the object in front of them.

What is the best way to disable player movement and rotation while the object is in front of them?

I would like the end result to be:

On left click -\> object shows up in front of the player -\> disables player movement and rotation -\> enables object rotation via mouse  
On Spacebar -\> object returns to original position -\> enables player movement and rotation -\> disables object rotation

Any help would be greatly appreciated! Thanks

---

<div class="post-metadata">

**Author:** ![Harcarik](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Harcarik](https://forums.unrealengine.com/u/Harcarik)\
**Post date:** [August 6, 2015, 5:46pm UTC](https://forums.unrealengine.com/t/disabling-and-enabling-player-movement-and-rotation-on-button-press/37743/2 "2015-08-06T17:46:28Z")

</div>

if you have ‘add movement input’ node in your BP or something similar, add branch node in front of that node with condition like ‘Is\_previewing?’ and connect false to ‘add movement input’. Upon pressing spacebar, set 'Is\_previewing? to true, so branch will not allow model to move. not sure if it is clear enough, can’t get to my pc at the moment.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_9678a9dd](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_9678a9dd](https://forums.unrealengine.com/u/anonymous_user_9678a9dd)\
**Post date:** [August 6, 2015, 7:00pm UTC](https://forums.unrealengine.com/t/disabling-and-enabling-player-movement-and-rotation-on-button-press/37743/3 "2015-08-06T19:00:10Z")

</div>

Thanks, that’s exactly what I needed! I ended up setting a Branch node right after all movement functions (keyboard and mouse). The Branch node required the “Stop movement” bool to be false. When left clicking on an object it sets Stop Movement to true, and when pressing Spacebar it sets Stop Movement back to false. Worked perfectly!
