Hi there.
So basically I have this app which has about 15 different scenes, they all work fine other than this one scene, which is recreating Pearl Harbour. The scene is fairly simple, but the OVR Profiler says I'm using 524MB of graphic memory (I'm assuming this is the issue and why my game is crashing when attempting to load this scene, as all other scenes work fine). The only problem is, when I remove a few of the other scenes, this scene loads fine. Am I using too many scenes?
The weird thing is, it works fine in the Unity Editor, and it actually worked perfectly on the Oculus Go device a few days ago, yet crashes now when attempting to load that Pearl Harbour scene.
Was wondering if anyone else had the same issue? Thanks
↧
Oculus Go - Game crashes on scene load (Unity)
↧
Unity crashes because of a certain function
So basically im trying to make a gun jam at random when it runs out of bullets, and you are supposed to enter the correct key, a randomized number 0-9 so that the gun unjams and reloads properly.. but when the gun jams my unity crashes.. What's wrong with the code?
ps I am a pretty new coder so please dont judge if I have done something terribly wrong :D
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class Weapon : MonoBehaviour
{
public Transform firePoint;
public GameObject bulletPrefab;
public int clipSize = 6;
private int ammo;
public float reloadTime = 1f;
private int JamChance;
public int chance = 30;
private KeyCode[] keys = { KeyCode.Alpha0, KeyCode.Alpha1, KeyCode.Alpha2, KeyCode.Alpha3, KeyCode.Alpha4,
KeyCode.Alpha5, KeyCode.Alpha6, KeyCode.Alpha7, KeyCode.Alpha8, KeyCode.Alpha9 };
private int current;
private int[] output = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 };
private string ammunition;
private bool isReloading = false;
public Text bText;
private void Start()
{
ammo = clipSize;
bText = GameObject.Find("BulletsText").GetComponent();
ammunition = ammo.ToString();
}
// Update is called once per frame
void Update()
{
if (isReloading)
return;
//Change so the ammo doesn't update every single frame
ammunition = ammo.ToString();
bText.text = ammunition;
//
//Reload if ammo is less or equal to zero
if (ammo <= 0)
{
JamChance = Random.Range(0, 100);
if (JamChance >= chance)
{
StartCoroutine(Reload());
return;
}
else
{
GunJam();
}
}
//Check if player hits the fire button, if yes then shoot
if (Input.GetButtonDown("Fire1"))
{
Shoot();
}
}
void Shoot()
{
//Shooting logic
Instantiate(bulletPrefab, firePoint.position, firePoint.rotation);
ammo--;
}
IEnumerator Reload()
{
//Display "Reloading..." in console
Debug.Log("Reloading...");
gameObject.GetComponent().material.color = new Color(1f, 0f, 0f);
isReloading = true;
yield return new WaitForSeconds(reloadTime);
isReloading = false;
ammo = clipSize;
gameObject.GetComponent().material.color = new Color(1f, 1f, 1f);
}
void GunJam()
{
gameObject.GetComponent().material.color = new Color(0f, 0f, 1f);
current = Random.Range(0, 9);
Debug.Log(output[current]);
if (Input.GetKeyDown(keys[current]))
{
StartCoroutine(Reload());
}
else
{
GunJam();
}
}
}
↧
↧
Game freezes/crashes only when built (never in the editor), and only on certain machines.
My game is freezing and/or crashing only when built. There has never been a freeze or crash in the editor, and I think it has something to do with DX11. The game will periodically freeze on certain machines, and while doing so will spam:
"d3d11: attempt to lock null buffer"
I think this generally happens when the player fire projectiles very rapidly (even though the projectiles are destroyed very quickly and GC is performed every 30 frames)
Using -force-d3d9 solves the issue on affected machines (as far as I know), and using DirectX 12 does not.
The game will freeze for sometimes multiple seconds, and will either eventually resume or remain frozen (however, the game can still be heard continuing in the background and responding to inputs) before eventually crashing (although a crash log is generally not created). In situations where it remains frozen, the log is spammed with:
"(Filename: C:\buildslave\unity\build\Runtime/GfxDevice/d3d11/GfxDeviceD3D11.cpp Line: 1547)
d3d11: attempt to lock null buffer
d3d11: attempt to lock null buffer
RenderTexture: Resolving a destination texture that is NULL."
If it helps, I am using a render texture in certain scenes, but not in the scenes where the crash occurs.
I've searched for a long while as to the cause of the issue, and so far the only solution I have found is per-machine (using -force-d3d9). Is there anything I can do to solve this problem for all machines without needing to pass additional command line arguments?
Any help is appreciated, as I've sort of hit a brick wall with this.
Thanks.
↧
GPU Consumption Skyrockets when Oculus headset taken off, disconnected
Hi there,
I'm attempting to maintain a Unity experience that uses an Oculus Rift S headset. This experience runs on a dedicated Alienware PC (Nvidia 1080) in one location. This game sits dormant most of the day, and is only used occasionally. The display setup: there is an Oculus headset and a projector, which, when the headset is not used, displays a video (using ProAV), and when the game is getting played, mirrors what you see in the headset on the screen.
The game has been crashing more often lately. According to the logs, it's sometimes due to a ProAV error that the comp was out of resources - which seems weird, the computer has more than decent specs and nothing is happening in-game. *the idle process does not seem to be expensive in any meaningful way - I believe this is a Unity Setting, Oculus Setting, Windows Setting or other setting at play.* Game doesn't crash during gameplay, which has a couple very expensive processes. Turns out the build was running at around 60% GPU usage while idle. When I put the headset on, the GPU consumption dips (?!!) to 30 - 40%. Lastly, when the headset gets disconnected entirely, the GPU consumption skyrockets to 90-100%.
When I take the headset off, the VSync process spikes, crushing the framerate to 15fps or so. To be clear, this coincides with the GPU/CPU spike. Forums say Vsync/WaitforGPU is not a problem, but.... my error makes me feel otherwise. What I think is happening: Vsync/WaitForGPU is spiking CPU/GPU usage, and as things are... running, oddities, other Windows processes push the computer (in its elevated consumption state) over the edge and the game crashes. This never happened (afaik) before I boosted the quality settings.
Regarding the behavior when headset is disconnected... can I turn this behavior off somehow? Since the experience is in another place, I can't manually check the cables every day to see if they are seated properly into their ports.
I am actively reducing my quality settings, etc. to mitigate, but i still find the spike in GPU usage (and subsequent errors) somewhat disturbing. Is this known behavior for Vsync/waitforGPU? Whole thing seems incredibly weird.
Apologies if this is a commonly-known topic - I didn't see a ton of info in my searches. Maybe I'm digging in the wrong direction? I can give more info about the setup: Unity Version 2018.2, using NewtonVR, *not* using SteamVR, etc etc - let me know what you need to know to tell me what I need to know. :)
Thanks!!
![alt text][1]
![alt text][2]
[1]: /storage/temp/152806-headset-off.png
[2]: /storage/temp/152808-unity-2018-2-li.jpg
↧
I'm experiencing constant crashes when the multiple game windows are open.
Hello there...
(Unity 2019.3.1 here) As mentioned, multiple windows start crashing after a few seconds of being open. I've tried to search for hints on the crash report, but quite frankly i have no idea of what to do with it: Where on the crash file could I look at hints of what is happening? Even the editor will sometimes crash if there are multiple instances of the game running. If anybody has any tips on how to **at least** start searching, it would be a godsend
Many thanks
↧
↧
unity 2019.3.0 f6 crashes when i install android support
hi
my project works fine with windows/mac build target but after i installed android support unity never starts again and its always crashing on project opening. did anyone faced this issue before?
please help me i contacted support but still no response.!
↧
Everything Relating to NavMesh Agent Crashes Editor,Everything Relating to NavMesh Agent Crashes Unity
I am working on a 3D project. My scene contains collider-equipped meshes, lights, and (of course) a NavMesh. Trying to view anything relating to NavMesh Agent in the inspector crashes the editor immediately. Clicking on a prefab that has an Agent attached, navigating to the Agent tab of the NavMesh window, adding an Agent component to an object; all of these things cause the editor to instantly crash. Do any of you know why this is happening and/or how to fix it?,I am working on a 3D project and currently, there's only a couple of scenes. The one that needs NavMesh just has a bunch of collider-equipped meshes, some lights, and, of course, the NavMesh itself. Now for the problem: showing anything relating to the NavMesh Agent in any part of the inspector crashes the whole engine. Clicking on a prefab with an Agent crashes it, clicking on the Agent tab in the NavMesh crashes it, adding an Agent component to an object crashes it. This is, obviously, a huge issue that I do not see any workaround for. Do you guy's know what's going on and how to fix it?
↧
Android 9 - Graphical freeze but scene runs in the background
Hello fellow Unity devs :D
I have a little problem. Everytime when I try to switch scene (From MainMenu --> GameScene) on my phone(Android 9.0.1, OnePlus 3T) the screen freezes.
In the background I hear the sound and the music of the game scene but I still see the loading screen of the menu scene.
Strange thing, other Android 9 phones work without problems and my phone worked also fine when I had Android 8.0.1 installed.
Did anyone of you ever have a similar problem or maybe knows what the problem could be here ?
Thank you for your help and have a nice day :D
↧
Unity crashes after I destroy a gameobject
So I wrote what I thought would be a simple script for destroying an object after doing something specific, but it crashes my game?
`public class DestroyThis : MonoBehaviour
{
public bool hasTalked;
void Start()
{
hasTalked = false;
}
private void OnTriggerEnter2D(Collider2D player)
{
while (hasTalked == true)
{
if (player.gameObject.tag == "Player")
{
DestroyGameObject();
}
}
}
void DestroyGameObject()
{
Destroy(gameObject);
}
}`
hasTalked becomes true once you talk to an npc, but once it does and the player triggers the object, the game literally freezes and there's no way to escape other than ending unity through Task Manager. What is the problem??
↧
↧
Unity iOS 13 Memory leak Crash
Hello!
We have been experiencing some memory leaks on our project, and we have no clue about what is going on. It does not happen always, I've been trying to reproduce it but it only happens like once every few hours. There is no pattern on when it happens. I've tried to connect the iphone with the unity profiler and, the unity profiler does not show anything strange. But When connecting with Xcode we can see that the game starts increasing the memory until it reaches the limit and the SO closes it. (Take into account that those "steps" are only because I've tried to go step by step in the execution from xcode, but without pausing the execution is simply a ramp up until it crashes.
I've tried to connect the iPhone and use the unity profiler but unity profiler didn't show anything strange, it showed the normal memory usage.
![alt text][1]
We are using: Adjust, Facebook, Leanplum, Amplitude, IronSource Crashlytics (this crash does not appear there, because it ran out of memory, so it cannot save/send the crash).
Unity 2019.2.13f1
I also uploaded the instruments alloc memory screenshot.
![alt text][2]
I've tried adding logs into Leanplum calls, and everything and I have no clue on how to solve it or which can be the problem. Anyone has faced the same problem?!
[1]: /storage/temp/153646-image-3.png
[2]: /storage/temp/153647-image-4.png
As I said, there is no pattern, sometimes simply having the game in the map menu without doing anything for few minutes and then it starts to consume a lot of memory.
I also attach: Instruments alloc screenshot.
We are using: Adjust, Facebook, Leanplum, Amplitude, IronSource Crashlytics (this crash does not appear there, because it ran out of memory, so it cannot save/send the crash).
Unity 2019.2.13f1
I've tried adding logs into Leanplum calls, and everything and I have no clue on how to solve it or which can be the problem.
↧
Unity closes when opening project
So, i have just downloaded Unity Hub on a new install. Now i made a project with 2019.3, but whenever i try to open it after creating it, Unity just closes. No error, no nothing. In task manager, Unity Editor just starts, stops responding, and then stops. Why is this, and what should i do? Like i said, this is a fresh Windows install.
↧
"Unity is already in the list. You cannot locate the same version."
So just now, at a fresh windows install, i wanted to go do my daily dev. However, it seems whenever i launch Unity, through Unity Hub or Unity itself, all it does is it opens hub and tells me "Unity is already in the list. You cannot locate the same version.". Come on, i just want to open it up. Whenever i create a new project it boots normally, but not after that. What do i do?
---
Edit: Log says "Exiting without the bug reporter. Application will terminate with return code 0".
---
Edit 2: I found out my license didn't activate since i haven't logged in. Fixed that, however it still just "crashes" wit the "Unity is already in the list. You cannot locate the same version." error in Hub. Log file doesn't even say what i said in Edit 1 anymore. Log link: https://pastebin.com/36Tj0XWw
↧
Big problem (or bug) in my unity, how to fix it?,
hi.
i have a big problem with my unity. i dont know why..
and i dont know its a bug or problem or...
i have two assets. for example named v1 and named v2.
assets v1 is fine and run without problems.
assets v2 can run. but not fine.
when i run the game in unity, ((assets v2)) this problem or bug is comming up !!
picture: ![alt text][1]
this picture is not for me. my problem is like this picture.
after this problem, unity crashed !!
i dont have this problem with other assets or other games or other programs or...
just in unity and this assets.
what is problem?
its a bug?
how to fix this?
(((((( SORRY FOR MY BAD ENGLISH))))))
[1]: /storage/temp/154152-problem.jpg
,
↧
↧
Unity crashes when I enable raytracing
I had a working pathtracing project but when I tried to build it Unity told me there was 800 errors when compiling the shaders.
I found that it came from HDRP/Lit and HDRP/LayeredLit shader that wouldn't compile with DirectX12.
So I came back to an old version of the project before I added raytracing, and tried to follow each step to activate it again.
But when I activate it in the ShaderConfig files, Unity always crash when I try to open the project.
As the crash log said it was nvwgf2umx.dll that caused an Acces violation, I tried to update my Nvidia drivers but it doesn't change anything.
↧
Game crashes on iPhone 11
So when i build a game on iPhone 6s, everything works fine, but when i build it on iPhone 11, gray screen appears and game closes. Is that a problem with resolution?
↧
Unity crashing after changing scene to "render paths"
I changed option from "shaded" to "render paths" and it crashed my graphic driver, and after this whole unity window is white, and I can't do anything. After reloading my project, graphic driver crashes again... What can I do?
↧
Game crashes with Chartboost SDK
[link text][1]Hello Guys Please help me to solve this problem, I've been trying to fix it for days and can't find the solution on google Here we go: My game crashes after I integrated Chartboost SDK, it runs normally in the frst time, but when I close the game and run it again it crashes at startup, I tried everything, different Unity Versions, different Googleplay Game Services versions but nothing works Please help to check the Log below and let me know what you think
Thank You All The Best
[1]: /storage/temp/155201-mylogcat-crash.txt
↧
↧
Unity Crashes When Spawning Prefab
Unity 2019.2.18f1
So, I'm trying to spawn in an item whenever the trigger is entered. It seems to work but it also crashes Unity almost instantly. It's hard to tell but looks like Unity is making multiple of these objects and that's causing the crash. How do I fix this?
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class CreateObject : MonoBehaviour
{
public Transform Spawnpoint;
public GameObject Prefab;
private void OnTriggerEnter(Collider other)
{
Instantiate(Prefab, Spawnpoint.position, Spawnpoint.rotation);
}
}
↧
UsedOnlyForAOTCodeGeneration - not managed to make it work
Hello
I am trying to use JSON serialization, but I am always getting ExecutionEngineException: Attempting to call method 'System.Runtime.Serialization.XmlObjectSerializerReadContext::EnsureArraySize' for which no ahead of time (AOT) code was generated.
I wrote the below function in the class where I am trying ReadObject that crashes.
public static void UsedOnlyForAOTCodeGeneration()
{
DataContractJsonSerializer serializer = new DataContractJsonSerializer(typeof(ProfileConfig)); ;
byte[] data;
FilesManager.ReadFile("test.txt", out data);
string jsonString = Encoding.UTF8.GetString(data); ;
Stream ms = new MemoryStream(Encoding.UTF8.GetBytes(jsonString));
ProfileConfig profile = null;
profile = (ProfileConfig)serializer.ReadObject(ms);
// Include an exception so we can be sure to know if this method is ever called.
throw new System.InvalidOperationException("This method is used for AOT code generation only. Do not call it at runtime.");
}
ProfileConfig is a structure, that contains and array: my_structure[] complete_structure;
I tried to allocate the ProfileConfig and all its components , no luck.
What can I do more?
Thank you for any hint.
↧
Trying to use a NavmeshAgent component causes this error: The number of settings (3) is out of sync with the number of setting names (2).
Adding a Navmesh Agent component to my gameobject through code causes the above error to pop up in the console. Attempting to go to the Agent tab of the Navigation window causes the editor to crash to desktop. I cannot find any fix for this.
↧