# How can I stop player movement while UI widget is on screen?

**URL:** <https://forums.unrealengine.com/t/how-can-i-stop-player-movement-while-ui-widget-is-on-screen/456481>\
**Category:** UI\
**Tags:** boolean, set, unreal-engine, player, UI, question\
**Created:** [October 5, 2019, 5:32pm UTC](https://forums.unrealengine.com/t/how-can-i-stop-player-movement-while-ui-widget-is-on-screen/456481 "2019-10-05T17:32:46Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![anonymous\_user\_7af0fcbf](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_7af0fcbf](https://forums.unrealengine.com/u/anonymous_user_7af0fcbf)\
**Post date:** [October 5, 2019, 5:32pm UTC](https://forums.unrealengine.com/t/how-can-i-stop-player-movement-while-ui-widget-is-on-screen/456481/1 "2019-10-05T17:32:46Z")

</div>

Im trying to create a level where the player can talk to an npc, so a Ui window shows up with a quest, and the player can choose if to accept or decline it.  
This is what I used to make the NPC check f the player is close enough to talk to it:

 ![289285-npc.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/d/3/1/d3146d43bcb473931b8baf1e1c8e43c42ae77ad9.jpeg)

Then I tried adding the widget blueprint to the viewport, and to stop the player’s movement and rotation like so:

 ![289286-ovreview.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/5/3/8/5386230cdabafb49754fb4033bd52065188bc857.png)

 ![289287-ui.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/6/3/9/6392c951f0c675efe41879adbee582b8d2c395dc.png)

 ![289288-player.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/a/3/f/a3ffedde7349e3c83fa9925c2861ae4360843410.png)

The “Player” variable is a reference to the third person character, and the “CanMove” and “CanRotate” are set like so:

 ![289289-move.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/5/1/a/51a9622d90a67663ce0b41267723edb734ef309b.png)

I’d show how I set the “CanRotate” if I didn’t alraedy used to many attachments, but the point is that I tried manually setting those two variables to false just to see what happens, and the player could not move or rotate.  
Currently, I can activate the UI screen, but the player movement does not stop.

Basically, what I’m trying to do is to set both “CanRotate” and “CanMove” to **false** whenever the player activates the UI screen, but for some reason theose two variables always stay on true.  
If anyone can show me how to fix this I’ll be really grateful ^^

\*\*Note: I checked with “Print String” if the player NPC knows that the player gets in and out of the conversation trigger area, and if the button press works, and so far it works. I know I still have to add more things but this is all I got so far…

---

<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:** [October 5, 2019, 5:46pm UTC](https://forums.unrealengine.com/t/how-can-i-stop-player-movement-while-ui-widget-is-on-screen/456481/2 "2019-10-05T17:46:35Z")

</div>

I see you setting CanMove and CanRotate, but not in the player. Am I missing something?..

---

<div class="post-metadata">

**Author:** ![Marcis](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/marcis/32/1103070_2.png) [@Marcis](https://forums.unrealengine.com/u/Marcis)\
**Post date:** [October 5, 2019, 10:37pm UTC](https://forums.unrealengine.com/t/how-can-i-stop-player-movement-while-ui-widget-is-on-screen/456481/3 "2019-10-05T22:37:01Z")

</div>

Two step process

1. Get character movement component → Set Velocity 0,0,0

2. Get the controller and Set Ignore Move Input, Set Ignore Look Input both to true. (you can use your Can Move variable but its cleaner to use the built in variables in the controller)

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_7af0fcbf](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_7af0fcbf](https://forums.unrealengine.com/u/anonymous_user_7af0fcbf)\
**Post date:** [October 6, 2019, 9:02pm UTC](https://forums.unrealengine.com/t/how-can-i-stop-player-movement-while-ui-widget-is-on-screen/456481/4 "2019-10-06T21:02:55Z")

</div>

I’m not sure what you mean…  
player is just a reference to the third person character where the values are sitting, so there’s no other place to set them.  
the setting of the values to false is supposed to happen in the NPC blueprint, if that’s what you meant.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_7af0fcbf](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_7af0fcbf](https://forums.unrealengine.com/u/anonymous_user_7af0fcbf)\
**Post date:** [October 6, 2019, 9:02pm UTC](https://forums.unrealengine.com/t/how-can-i-stop-player-movement-while-ui-widget-is-on-screen/456481/5 "2019-10-06T21:02:58Z")

</div>

CanMove and CanRotate are variables sitting on the third person charcter movement, and the seting of them to false happens on the NPC blueprint.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_7af0fcbf](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_7af0fcbf](https://forums.unrealengine.com/u/anonymous_user_7af0fcbf)\
**Post date:** [October 6, 2019, 9:03pm UTC](https://forums.unrealengine.com/t/how-can-i-stop-player-movement-while-ui-widget-is-on-screen/456481/6 "2019-10-06T21:03:56Z")

</div>

It works! Just what I neede, thank you so much for your help ^^
