I was following a tutorial on how to make snake. https://www.youtube.com/watch?v=N0QbmNZlxhw&list=PL1bPKmY0c-wnka3TTQhX7mfn9UoVXNP3H&index=1 When Unity crashed and I had not saved it once, however I still have the scripts for it. I tried to make it again but the map won't show up. I looked at the alpha but it was just fine. I need help finding out how to make the game again with the scripts.
You are out of luck, save your scene frequently and before testing/building. If Unity crashes your scene/inspector changes will not recover. Your scripts, however, as they are separate files retain their changes.
For avoiding this in the future I recommend you to use a Version Control System
And within the options of VCS I recommend to you Git
Related
I have a Samsung Galaxy Tab Active 1, on the latest version of android it can handle, and just recently, after adding accessibility features that shouldn’t affect anything, the balls in my game stopped updating. I instantiate a ball, and change a few properties on it, and then for some reason I think it’s not calling the update method. There are no errors.
I’ve heard using PrefabUtility to instantiate might help, but I haven’t done that just yet. I will update if PrefabUtility works.
Any advice?
Whoops, this was due to me being a bit stupid. The main reason it was happening was because of a parsing error in some of the accesibility settings, as they were not saved correctly due to weirdness I can't wrap my head around with files in Android. TLDR: file did not save correctly, and so did not load correctly, and so data messed up, and so it errored before it could do anything.
This is my first time to make a Unity project. Everything works well on the Game view in Unity Editor. However, after I built the project and played it on Google Chrome, I found that the position of some gameobjects had been changed.
Here is a more detailed explanation. The left is what I saw on the game view, which was perfect. The right side is what I saw after built the project. The position of the grey picture had been changed.
Does anyone know how to fix this?
ps.I am using Unity 2020.3.18 with WebGL platform
Try exporting again but with the same resolution as the game view. In this case you would want to export in a 400x600 resolution (You can also edit the "index.html" file to change and experiment with the resolution). The problem has to do with the fact that changing the resolution of the game can affect where certain objects are and how much you can see.
Good evening,
Recently I was trying to create an app in Unity where with a button I could open an image or a pdf while the app remains open and running. I tried to do it with Unity, and I didn't see any problem. However, when I used the HoloLens emulator, every time I did it the app opens the file but then closes.
I thought that maybe if I defined several 2D Empty Objects (as Images, Raw Images...) the app would still run while doing this. To do this, I used the WWW class and the example of the Unity Scripting API.
https://docs.unity3d.com/ScriptReference/WWW.html
However, I don't know why when I run the app the Image doesn't change... I also tried the SetTexture() method it still doesn't work. So I was wondering if you have encountered the same problem, and if you could help me to solve it out.
Thanks a lot for your help!
Best Regards
I'd suggest looking up the following post: change texture
It comes down to defining a gameobject, making a prefab out of the Image and setting the material of the prefab. You can easily make new materials by importing an image or making one using projects tab>Create>Material. You could try making 2 Materials with different colors to test it.
It could also be code that needs to be run using UWP outside of the editor, if that's the case, you could use
#if !UNITY_EDITOR
//Put your code here.
#endif
I'm working on a Vuforia (legacy) application.
In "Play" mode in Unity I can see that some "DontDestroyOnLoad" content is being generated, (looks like it's sort of a camera).
This might be a reason of why I have some problems when switching between the scenes, so the question is how to make these elements "destroyable"?
'DontDestroyOnLoad' It means that they won't manage it automatically. so if you want to destroy it, you should destroy manually like
GameObject.Destroy(GameObject.Find("TextureBufferCamera"));
My game is crashing whenever I switch scenes and then press play in the editor. I am using this code to switch scenes:
...
I have tried disabling most of the scripts in my game to debug the problem but it freezes every time. I've also tried loading the levels without the co-routines but that doesn't help. I can continue playing the game as long as I don't use the editor controls, however things get pretty choppy and performance becomes terrible.
First, look at the editor logs, quite possible that the reason of the crash will be there. If unsure, post them here (post on gist and link here).
Also, if you have unity pro (or a trial version of pro), try looking at the profiler's readings. On free you can also try looking at the Stats button from the Game window. Using too much memory (RAM or VRAM) can cause crashes.
i was also having same problem. if your program is correct then just change the editor path to anything in unity hub and save, close unity hub, open again and set the path to previous one.