aws / lumberyard

Amazon Lumberyard is a free AAA game engine deeply integrated with AWS and Twitch – with full source.
Other
2.03k stars 540 forks source link

How to get mouse cursor, while not leaving the game mode? #396

Closed RomanZhu closed 5 years ago

RomanZhu commented 5 years ago

While looking at samples I tried to look at entities in Entity Outliner. But mouse can't leave game view until I exit the game mode by pressing Esc. image

Am I missing something?

joshbeacham commented 5 years ago

You are looking at a game entity that is rendering a UI Canvas in game mode. To view and edit the UI Entities in the UI Canvas you need to open the UI Canvas in the UI Editor. You can use the Preview button in the UI Editor to quickly preview how the UI Canvas will behave in game mode.

https://docs.aws.amazon.com/lumberyard/latest/userguide/ui-editor-intro.html

RomanZhu commented 5 years ago

I know how to edit UI. The problem is mouse can't leave game view, while it's playing.

joshbeacham commented 5 years ago

If you want to unconstrain the mouse in game mode, then your options are limited. Generally, you can show the mouse by pressing alt-tab. The mouse is usually visible when the console is open, which is opened by pressing ~. You can also look into AzFramework::InputSystemCursorRequests::SetSystemCursorState passing UnconstrainedAndVisible

RomanZhu commented 5 years ago

That's just not user friendly to constrain mouse that way with mouse being visible.

RomanZhu commented 5 years ago

Answer to joshbeacham's removed comment:

Sorry I don't want to sound rude, english is not my native. With opened console I can move mouse outside of game view, but I can't click on things. I can't add that C++ line, as I don't have any IDE for it.

joshbeacham commented 5 years ago

This behavior is how game mode is supposed to work, as the perspective window approximates what a user would see when launching a stand alone executable. When a user launches a game they won't see the editor to be able to interact with it. Why do you need to be in game mode to click on entities in the outliner?

Perhaps the AI/Physics mode might be what you're looking for. Try clicking on this button.

image

If you need an IDE, most people I know that work on C++ for Lumberyard use Visual Studio. You can get a free copy of the community edition from Microsoft. https://visualstudio.microsoft.com/vs/community/

RomanZhu commented 5 years ago

That button is disabled once I go into play mode.

The reason why I want to look at entities during play mode is debugging. For example go to some part of the level, see something is misbehaving, go to outliner, select entity and look at what components it has how properties are setup.

That's how it works in Unity and afaik in Unreal. We pause the game in game view and go into scene view to find the problematic entity. Click on it and investigate.

raphabigal commented 5 years ago

I don't think this functionality is available in lumberyard right now, the editor doesn't reflect stuff from your game mode

Overall I'd say the workflow is a lot less editor-centric than unity and unreal from which you saw this functionality.

RomanZhu commented 5 years ago

Alright, thanks I saw there is IMGUI gem, which adds ability to look at hierarchy inside game view, but it seems like a hack for me.

Will leave issue open until any lumb's developer will say that is intended or it will be added.

sconel commented 5 years ago

Hi @RomanZhu, apologies for the delay. being able to use the mouse cursor outside of the Editor viewport during game mode is currently not-supported. Are you looking to edit entities during gamemode or just to look at their components and properties?

RomanZhu commented 5 years ago

Edit them too

sconel commented 5 years ago

Hi @RomanZhu, thanks for the feedback. I've passed on the request to view and edit these values in Editor Game Mode. Please let me know if there's anything else I can help you with.