I'm a newcomer to Unity3D development, and, while following a tutorial to make my first game, I noticed that a few steps I kept repeating as I flipped between the Unity application and my browser (chrome), which were both in full screen, certain steps that I had made would occasionally be reversed when I returned.
The two times I noticed it happening, GUISkins and Scripts that I'd added to game objects had been removed.
Has anyone had a similar problem? To prevent this, do I save the scene or the project? Does Unity offer some sort of Autosave function?
Thanks in advance :)
The changes made to the scene while the game is in play mode will not persist. Once you get out of the play mode, the changes made will be reverted.
Related
I have a 3D game, and I added a trigger that loads the next level with a small animation when the player goes through it. It all works fine in Unity editor, but when I build the game it does not load the next level, neither it shows the animation. Any ideas what could be wrong? Thank you!
Hard to say without more detail, but in general it boils down to one of two things. Either the trigger is not firing, or there's a problem with the script.
Try attaching something else to the trigger, maybe something that will enable a disabled GameObject in a position that would be visible when you're hitting this trigger. If that doesn't show up, that tells you the problem is with the trigger.
Otherwise, you have a script issue. The most likely cause is that you're trying to load a scene that isn't listed in the project's Build Settings. Double-check that the scene for the level you're loading is in there, or it won't get built into the project. If the call to LoadScene/LoadSceneAsync is in your script before the call that is running the animation, then if it errors out due to the scene not being available, it would never reach the point where it plays the animation, which would explain what you're seeing.
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 am currently developing a game for the Vive using Steam VR. After updating to 5.5, Unity is freezing when I try to load into roughly half of my scenes when playing in the editor (I have not made any changes), but when I build and run, Unity does not freeze and everything works as would be expected.
I have gone as far as removing all game objects from a scene and replacing the vive camera rig with a unity camera and clearing all baked data, and even then, when I load into the empty scene the Unity editor will still freeze. This is very strange because I can load into some of my other scenes without them being affected.
One thing that I have noted is that the affected scenes that I can not load into I have heavily been working on in 5.5 and not so much in 5.4, so perhaps there is something there?
All of the scenes use the same prefab for a character controller, and the only scripts in my scenes are attached to that. I am really at a loss here. Any ideas or thoughts about things I can try to resolve this would be much appreciated!
As I stated previously, the game builds and runs completely fine, but the editor in play mode freezes when loading into some of my old scenes, even after removing everything from them and only leaving in a Unity camera object to sum it up.
I also have deleted the library folder and reopened my project with Unity and this did not fix it either.
I have finished my game in Unity already.
But whenever I'm trying to build the game, it stops at the point as shown below. Does anyone know the reason why it happens? It always stops at the same point....
It's a problem with baking the lightmaps on your scene.
Unity doesn't like huge objects when it comes to baking lightmaps on them and it can certainly kill the light transport on a build.
You can try to open the Window menu from the main Unity menubar and search for the "Continues baking" checkbox under Lightning and uncheck it.
Or you can just split your bigger objects on your scene which may cause this problem.
Here's a thread detailing the issue a bit.
I've also seen people working around this problem by disabling Global Illumination altogether so that may be a solution for you as well if you are using it and you are willing to give up on that feature.
Edit: Another thread about this sort of thing with a decent solution - not sure why I didn't remember it for first but it's a good idea before trying to split your huge objects to mess with their "Scale In Lightmap" property as well to reduce the lightmaps' size.
You can also try the "Advanced Parameter" options.
I have an issue in Unity3d v5 where my joystick does not work as intended, When i plug in the joystick, moving it right from the center, gives me -1 and up to 1.
Keeping it completely center, gives me 1 and moving it left gives me 1 (so no change in value moving stick left.
From what ive read it has to do with using RawInput and not using DirectInput.
I have read a post where someone suggests using a registry change to force unity to use directinput. But it does nothing for me using unity3d v5.
Can anyone please help me, because i am completely stuck on this and getting this joystick to work is essential for my game :)
It's very difficult to find any information about this issue from an official Unity source, but take a look at the answer here: Joystick not working
And follow through the threads referred to there. The upshot of this all is that RawInput is all you can rely on for joystick input, on windows. The best solution to this problem I can think of is runtime calibration in your game/app. If you don't care to implement that yourself, there are 3rd party options such as this one, that integrate with Unity: cInput 2
I am running into this same problem with my Unity projects, and my plan is simply to present joystick users with the option to calibrate. You could save the calibration settings so the user doesn't have to calibrate every time the game is run. Not ideal, but again the most realistic solution to the problem I can come up with.