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.
Related
I'm a beginner in unity and programming, I was following a video for making a Flappy Bird game. Everything works perfectly but when I run the game, I get a floppy disk icon middle of the screen and somehing called DontDestroyOnLoad starts working out of nowhere. I couldn't find or understand anything on google when I search for it. I'm posting the screenshots in case anybody wanna see it.
This icon and dontdestroyonload thing only appears when game is being run:
There's a little button in the type right of your scene and game view called "Gizmos", un-toggle that button, should fix your issue.
Also don't worry, Gizmos can only be seen in the Unity Editor for level editing and debugging purposes --> if you were to build the game, for instance on IOS, they would disappear.
(if this doesn't fix your issue, then I would just create a new scene and copy your gameobjects over one-by-one)
I see someone responded about the main part of a problem, but I'll clarify about dontdestroyonload
Don't destroy on load is collection of objects that won't be destroyed when new scene will be loaded, usually objects there come from running them through DontDestroyOnLoad method somewhere in a script, however I noticed that some time ago Unity creators started to put there some stuff related to built-in tools (like debug)
I'm new to Unity and I'm trying to make my own game (or at least learn to). I have a problem in the scene screen.
The scene screen is stuck on this mode and I don't know how to bring it back to the original camera view(hope you guys understand what I'm meaning), Tried to search how to do it but couldn't specified what I want, please help.
The Canvas when in Overlay mode turns out to be a giant object compared with normal scale.
You are just too far from your objects, to return to normal you can navigate manually right clicking Scene window and moving with WASD and QE.
Another workaround is that you use the FIND shortcut like following:
Click the object you want to find on Hierarchy window
Move your cursor to Scene window without clicking
Press F on your keyboard
If perforned correctly the Scene camera will find that object and you will be right back to where you were.
I have made a simple 3D game in Unity and for the most part everything works, but when my player dies the mouse is not visible on the death screen.
I have two other scenes with what looks like to me the same exact settings, yet the mouse on those is visible.
Try to check your script. search for Cursor.visible
https://docs.unity3d.com/ScriptReference/Cursor-visible.html
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.
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.