How to make Unity Play Mode NOT force screen focus to Unity Editor? - unity3d

The Unity project I work on takes a moment to run after pushing Play. Often times I'll hit play, and while it's thinking, will click into another window (I'm always looking up data I need to verify in the game). So while I'm looking at something else or typing something, Unity will wrest control of the screen and force the cursor into Unity editor and make Unity the focused window on my screen once Play gets going.
Is there a way to turn this off? I want to be able to hit play in Unity editor, and be able to ignore it and have it run like any other window, doing its thing where I left it. I don't want play mode to force the Unity editor to become the focused window.

In recent Unity versions, the Game window has a dropdown that says Play Focused, change it to Play Unfocused.

Related

Steam VR Input Settings resets after hit the play Button

I try to add Joystick Movement but every Time i delete the old Joystick Input Settings and add the new one it resets after i hit play
It feels like a bug, beacuse it works days before with other Input's (OpenInv and OpenHelp)
There are no Errors in Console
SteamVR Input Window
This is what i want but after i hit play it resets to both side "SnapTurn"
SteamVR Input Settings
My Unity Version is 2019.2.17f1
Hope anybody can help me and Thank you

How to update runtime scene via the editor

Is it possible to update the' position/rotation of an object in a running game by setting its properties in the editor. In other words, when I change something in Unreal editor I'd like to see it change immediately in a running instance of the game.
Yes, it is possible. Steps to do so (tested in 3rd person template, UE 1.17)
Play in editor
Hit Shift + F1 to show mouse cursor and unlock from viewport
Click on Eject button (it is on upper toolbar where Compile, Play and Launch buttons are.
Click on mesh on scene and edit it's properties
Hit Posses button (now instead of Eject)
Play in modified world
Be aware that editor will show some warnings if you move Mesh with Static Mobility. Also, shadows could be off (especially if you are using pre-built lighting).
EDIT: there is another procedure: instead of PIE, you can start Simulate (Alt + S). Then you don't need to do Unposses / Posses actions, just edit properties. There is a catch - your game needs to be playable in Simulate mode. From my experience, due to various reasons I couldn't run one of my game in Simulate, so I had to repeat that 6 steps I mentioned earlier.

Cursor not showing

As we develop a little game with defold (defold 1.2.102 | defold editor 2) we encountered the following problem:
When we start our game the window shows everything we built properly and there are no build errors or error console logs. However there is no cursor. Neither on the levelscreen of the game nor on one of the other monitors. We added a keypress input for testing the buttons and it worked properly, but the problem remains: Where is our mouse pointer? Do we have to add or adjust it somehow?
Thank you for your help!
Are you running your game in fullscreen mode? Defold always hides the mouse pointer while running in fullscreen mode. You can add a game object with a sprite (or even better a gui box node) and let that follow the mouse coordinates and use it as a custom pointer for your game.

UE4 Enabling Mouse During Play?

I'm extremely new to UE, and doing a few easy tutorials to get started, so I don't exactly know the correct terminology to use to help me find what I am looking for... Anyway, whenever I hit play and the game starts, my mouse disappears and I am only able to use the input that I set up; so my question is, even though I do not need mouse input for movement, as I am using WASD, how do I keep my mouse unlocked and available to move around without being locked to the camera?
When you hit play and the game starts, your mouse gets captured by the game to control the camera. If your play button is set to play in the viewport, you can release the mouse from the viewport by pressing Shift-F1. The game will still be running, but input (including from the keyboard) will be suspended and you can interact with the editor.
You can also change the default behavior of how the mouse is captured and it if is constrained to the viewport boundaries. To see these options, go into the project settings (settings button above main viewport/project settings...). On the left side of the project settings window, select 'Input' under the Engine heading. On the right side will be some mouse preferences that can change its behavior.
For instance, to allow the mouse to travel outside the viewport, change 'Default Viewport Mouse Lock Mode' to 'Do Not Lock'. I don't recommend this, but you might experiment with these to get a feel for what they do. Also, you might look up these settings in the Unreal documentation for more detail.
There are 3 blueprint nodes that change the input method:
Set Input Mode Game
Set Input Mode Game and UI
Set Input Mode UI
You want a combination of the second one and a "Show Mouse Cursor" node. However, if you are making an FPS and you use the mouse to look around, you may lose that ability with the second node above. It comes down to what your game is and how you want to use the mouse.
I had the similar issue. So I did something like this in Level Blueprints to achieve what I want.

simple UI menu and canvas for DK2

I am using Unity 5.1.2p3 with DK2 SDK 0.6.0.1 and I understand from this post that Screen Space - Overlay is not supported in Unity VR. It is recommended to use Screen Space - Camera (which in my case does not work) or World Space (which I am using now) but I need someone to help me understand how I get simple menu with buttons and toggles to show as a still image and how I can make selections and button presses with my mouse cursor.
I have created a menu for my app, with 4 toggles and 1 button. When I check the Virtual Reality Supported option with the Oculus being in Direct Mode and Canvas being in World Space, I can see it in VR, but I cannot see/find my mouse cursor to tick one of the toggles.
When I take off the headset, on my monitor's Game View tab, I can see and even use the mouse and select a toggle. Obviously, I have to keep the headset steady, so in my Game View, things do not shake!
Another thing I notice is that the VR camera is the same as the Main Camera in the Unity Hierarchy, but when I take off the headset and move it around, the position of the camera does not change, only looking up and down and around is reflected.
How do I simply do a static menu like a 2D surface that does not move in VR and a user can use button presses and muse clicks with the headset on? What settings are required for this way of doing UI and canvas stuff? There are 2 attachments, showing my current settings...
Are you specifically wanting to use the mouse? If you look through a blog entry I wrote below, it will show you how to use Gaze looking to trigger menu buttons:
http://talesfromtherift.com/vr-gaze-input/
You can achieve this by some code I list there that raycasts from the center of the screen and if it hits any UI, it will trigger the correct events and make it clickable by button (or by time).