Viewport focus losed

I lose viewport focus when I click any object (static mesh).
I have a widget with a Start button. “Show Mouse Cursor” is enabled because I need it is visible.

Any suggest?


If you are saying you lost were your level was in the map in the top right corner there is a panel that has the objects and stuff that are placed in your level/scene. Click an object that is in that panel and then press the f key and it should then follow you to the object.

If you are trying to get a widget to display when you hit play in the level, go to the levels blueprint and get the event begin play node and then add a node called create widget node and assign it to your widget. Then get the player controller I believe and connect it to the create widget as well. Then drag off the create widget and add a node called add to view port.

Hope this helps! :slight_smile:

Thank you for answer . I execute play in the level and my button Start (in the widget) appears in screen, I click on it and can walk and rotate camera, but some thing wrong happens when I click on any place (into viewport)… I can still walk with “ASDW” keys, but camera don’t rotate when I move the mouse like it did before clicking.

Here you can see my widget and my level blueprint:

I think what it is is you are not removing the widget when you click play or what you have it set up to, so when you hit play I see it says remove from parent but I think the event begin play might be activating the widget again. Its basically thinking you are still in the widget screen with your mouse wanting to select something.

I’m not a pro with UE4 so I could be wrong lol honestly I’m 16 and started UE4 a year ago lol.

Anyways hope this helped! :slight_smile:

**EDIT: OHHHHHHH I think I know whats wrong. So when you have On clicked, Remove from parent, Set input mode game only, you then have a SET ‘Show Mouse Cursor’. I belive that is making it behave like if a widget is displayed, so uncheck that and see if it fixes. **

I don’t see the cursor if I uncheck the “show Mouse Cursor”. This is my great problem. I need to see the cursor in the game. When I uncheck it, all work fine, but I don’t see what I’m clicking :slight_smile:

Did you uncheck this one?

If not, uncheck this one and do not uncheck the other set, because what is happening is you want the cursor to show up when you are at the menu but when you click play, ‘which is going in this photo I belive’ you want to execute the cursor.
I think this is the problem.
If that doesn’t work it could be your event begin play is activating more than once and is causing the set cursor to activate repetitively.

Hope that fixes it! :slight_smile:

I check this one to see the cursor in screen. I don’t know what mesh I’m clicking if I uncheck it. I’m sure the event is activating more than once but I don’t know how to “kill” this activation…

Alright, then try to drag off a DoOnce node from the event begin play. So it insures its only activated once.

Hi saywe6913, thankyou for your suggestions. I tried “DoOnce” but it doesn’t worked. I begin to suspect it is a Unreal bug. May be my blueprint to change materials is wrong.

I DID IT!!! I regained control input adding “Left Mouse Button” and “Set Input Mode Game Only” to my blueprint level :D:D:D

Here is the squeme:

Alright cool!