Widgetブループリントの表示の時

Boxコリジョンに入るとWidgetブループリントが表示され、WidgetブループリントのCloseボタンを押すとWidgetブループリントは非表示になってくれるのですが、Widgetブループリントは非表示になった時にThirdPersonCharacterが勝手に走っていってしまいます。
SetGamePauseで止めていると思っているのですが、どこか間違っていますか?

何が問題なのかもう少し具体的に表したほうが良いと思います

本文内容と添付画像を突き合わせた結果、特に意図から外れた結果になっているようには見えません

分りづらい説明になってしまいすみません。

問題としては、WidgetをCloseボタンで閉じた際に、その場にThirdPersonCharacterが止まっていてほしいのですが、
勝手にずっと歩いて行ってしまう状態です。

from what google translate gave me and your screenshots. I’d say that the “Set Input Mode Game And UI” causes your character to get the input. The funciton name implies that it is meant for game (e.g. moving your character) and the UI at the same time. Like a loot menu, so that you can run away if enemies approaches :wink:

返信いただきまして有難うございます。
返信いただきながら申し訳ないのですが、英語の為、記載されている内容が良く解りませんでした。

BoxコリジョンのBP内の最後に配置している,
Set Input Mode Game And UIが違っているということでしょうか?

試しに、Set Input Mode Game onlyに変更し、Set GamePausedを追加しPausedのチェックを外してやってみました。

そうすると、Widgetをcloseボタンで閉じた時に、勝手に走っていってしまうというのはなくなり、その場にThirdPerson Characterが止まっていてくれるのですが、操作が何もできない状態になってしまっています。

回答いただいた内容と違うことをやってしまっていましたらご指摘いただければと思います。

For your pause menu you need to execute Create the Widget, “Add To Viewport”, “Set Input Mode UI Only” and “set show mouse cursor” to true (you can drag that out from your player controller) and “set Pause game” to true. For closing the pause menu you can setup inside your widget: “set Pause game” to true, “Set Show Mouse Cursor” to false, execute “Set Input Mode Game Only” and execute “Remove From Parent” (opposite from “add to viewport”, it destroys the widget).


The 3 Functions “Set Input Mode UI Only” “Set Input Mode Game Only” and “Set Input Mode UI and Game” are meant to be executed seperately, not 2 or all 3 at once. I don’t know what exactly happens inside these functions, but you could think of them like a bundle of steps you would need to execute if you want your game to handle input in a certain way.

Set Input Modes are:

Game Only would be your standard behaviour. The mouse cursor is deactivated and captured by the game window. Your Character takes your Inputs.

UI Only is usually used if you open a menu and pause the game. You mouse cursor is activated (still invisilbe) and all Inputs are consumed by the UI. You can’t move your character.

Game and UI is a mixed mode at wich your cursor is actived and you can still rotate the camera by holding the mouse button and draggin, Also you can move your character.

I know you don’t understand english very well, but maybe watching Mathew Wadstein helps WTF Is? Controller: Set Input Mode in Unreal Engine 4 ( UE4 ) - YouTube

let it be known that your mouse cursor will always be moving, but it can be made invisible and locked to the game window when it is captured. “Capturing” the mouse cursor means that you click on the game window and the window gets “focused” that way. Locked means that your coursor can’t escape from your game window (helpful in windowed mode [alt+enter]).

返信いただきまして有難うございます。
とりあえず添付いただいていたキャプチャのようにノードを組んでみました。

プレイして確認してみたのですが、
Boxコリジョンから外へ出た場合に、Widgetが表示され、Closeボタンで閉じるとやはり、勝手に走っていました(失敗していました)。
プレイをそのまま続行し、再度Boxコリジョンに入って外に出た場合は、WidgetのCloseボタンで閉じた時に、ThirdPersonCharacterはその場に止まっていました(成功していました)。
1回目は勝手に走ってしまう、2回目以降はきちんとその場に止まっているという現象になっています。

プレイを停止して、再度プレイで試してみましたが、やはり1回目は勝手に走っていってしまう、2回目以降はきちんと止まっているという現象になってしまっています。

原因は何だと思われますでしょうか?

if you are using an animated character model, the activation on leaving the trigger/collision box might be caused by your character model. If you are using the “Actor Begin Overlap” every component with collision in your actor will be taken into acocunt. So by chance your characters arm swings back in the animation, while you are leaving the trigger/collision box it reenters and activates the overlap event.

You could use the begin overlap event of just the capsule component of your character blueprint. (inside of your character blueprint, click on the capsule collision and scroll down to the green button in the details panel)
Or Try to deactivate the overlap with your trigger box in your skeletal mesh component of your character.

by the way: you can mark an answer as accepted with the check button below the rating of the answer. :wink: