Mouse Cursor and Inputs | Possessed Pawn

Hello! I am trying to use enable/disable mouse and use custom action inputs as a Possessed Pawn.

Currently, I possess a pawn with a key event “F” and flip/flop possess MyCharacter. I am trying to figure out a way to enable cursor and mouse events for UMG HUD Widget while possessing another pawn.

I found the “Auto Receive Input” but even having this enabled, key events that would trigger UMG events, doesn’t work. Maybe there is something I am missing?

Also, I noticed that when using possess pawn, the pawn automatically receives the UMG HUD widget that is added to View Port in MyCharacter.

On that pawn, I want to have a different UMG Widget added to view port. This works if I change the default pawn in MyGame to the pawn in question. Why does possessing a pawn not use the Widget that is being added to view port?

I found the “Auto Receive Input” but even having this enabled, key events that would trigger UMG events, doesn’t work. Maybe there is something I am missing?

You should try “Inputmode UI and Game” (it’s a bit longer but I can’t recall the exact name). If you search for “UI and” in the context menu with the reference from your widget (the pin you get form “Create Widget”) it should show up.

Also, I noticed that when using possess pawn, the pawn automatically receives the UMG HUD widget that is added to View Port in MyCharacter.

On that pawn, I want to have a different UMG Widget added to view port. This works if I change the default pawn in MyGame to the pawn in question. Why does possessing a pawn not use the Widget that is being added to view port?

Where is it added? Unless you are removing the widget on “Unpossess” and add a new one on “Possess” it will just keep your current widget. So if you added it during the construction script, event begin play or anything like that it won’t change.

Cheers :slight_smile:

Say that MyCharacter is adding GameHUD widget to view port via event begin play, and on MyPawn I am adding SpectatorHUD widget to view port via event begin play.

If I change MyGame to use MyPawn as default, the SpectatorHUD works, but if I possess MyPawn, I am still receiving the GameHUD from MyCharacter. I am assuming it is because I am “possessing” the pawn…

nonetheless, I have come up with a simple toggle (flip/flop) that will allow me to switch my HUD widget based on bool - It works fine!

Now with input… I have tried a few different things as far as setting the input to Game and UI, which was able to enable my mouse and I could interact with the UI. However, I want to setup key events to add widgets to view port while possessing the Pawn (TAB to show menu etc…) which do not seem to work.

the pawn is based off of “Spectator Pawn”, should I be using this one or “Default Pawn”? Does it matter? I am basically wanting a flying pawn that can use key and mouse events that can interact with the HUDWidget and objects in the world via click events.

Sorry for the long reply… But if you have any advice, that would be awesome! Here is BP_MyCharacter toggle that I set up…