Unity 3D freezing after leaving Game Mode (MRTK) - c#

I've been working in a project some weeks now in a Mixed Reality project using Unity and MRTK and I've found a strange behaviour when adding screen capture to the application. I'm using Unity 2019.4.26f1, and I haven't found any issues so far but after adding this line of code
ScreenCapture.CaptureScreenshot("test.png");
into a script, I've realised that when I press Play and go into Game mode, everything goes correctly (the game starts, the screenshot is taken). BUT when I stop it and try to go into Play mode again, Unity freezes. If I don't press Play again, Unity still works until it tries to compile scripts or some heavy task like that, when it freezes and can only be closed with the task manager.
If I remove that line, Unity goes back to normal.

This issue cannot be reproduced in Unity 2020.3 LTS. Does this happen when the remoting play or in Editor? According to Choosing a Unity version and XR plugin - Mixed Reality | Microsoft Docs, if you target to HoloLens 2, please upgrade to the recommended 2020.3 LTS version that is stated in the document.
In addition, ScreenCapture is a Unity built-in class and if there are any usage questions, you may find support from Unity forum.

Related

Unity editor frame drops on Mac

I'm trying to use Unity in a Mac but the editor drops frames all the time. It shows it's rendering 330 fps but still feels laggy and dropping frames, also enemy movement is weird (I think it´s because it's dropping frames). This doesn't happen on windows (I tried both platforms). Before I used metal, and it rendered 35 - 45 fps dropping frames too. When I switched to OpenGL it went up to 330fps. I think the problem is not performance, but incompatibility of some kind. When I play the game built for Mac it works well.
Any idea of what could it be?
Statistics using OpenGL:
Statistics using Metal:
Make sure metal is enabled in the editor (not just when you export the game).
https://docs.unity3d.com/Manual/Metal.html
in old unity version metal was not enabled by default on mac and you had to use -force-gfx-metal and start the editor with terminal command line.
If it still not working I'm not sure what you can try... maybe try also to change your screen res.
Remember that Unity editor always use more resource, if the game is working fine when you export the game you can ignore the problem.

Cannot display Ovrvision image on Unity application

I am Using Unity 5.4.0f3 Personal(32bit), I developed demonstration application to display camera picture and three-dimensional AR which I acquired in Ovrvision Pro on Oculus Rift.
So I place prefabs, OVRCameraRig (view point camera) and OvrvisionSDK (Ovrvision imaging) from package ovrvision_unity5_includeOVR.unitypackage, and locate moving 3D objects. I intend an application that the 3D objects are moving in front of the video captured at Ovrvision.
Placing image
However, Ovrvision seems not to be recognized. The inspector of OvrvisionSDK says "Ovrvision status closed". And pressing [Play] button, "Ovrvision Open Error" occurs.
Ovrvision Open Error on Play
And when I connect Oculus Rift into the PC, the Unity editor crashes.
The version of Unity editor is 5.4.0f3, and the firmware version of Ovrvision Pro is 1.1, the latest.
I started developing with Unity only one and half month ago, and I may misunderstand the role of various packages and prefabs of Unity.
Best regards,
ichihara456
I am not sure if this is the solution to your problem, but I had similar issues with ovrvision (not using Unity, though). Turns out that in my case one USB port I was using was not a USB3 port (needs to be blue).
Might be worth a try...
Good luck!

Problems with integrated vuforia with 64 bit Unity

Basically, I am having trouble playing my augmented reality app in the Unity. I have done all the right things but the app just won't play. It is a very basic app that adds a spinning cube on some real life it sees in the real world. I know that vuforia can't handle the 64 bit Unity but i was hoping that there was either a hack or some emulator that I can use to open the unity scene with or something epic that I can't even conceive of. These are my first steps into augmented reality programming and it would help to actually see it work on my pc.
As far as I know, you cannot use 64 bit Unity with Vuforia. It may work for some features of Vuforia but you definitely will not be able to use the full functionality of Vuforia--there will always be problems.
One solution is obviously to just uninstall your current version of unity and install a 32 bit version (I would suggest Unity 5.1.3 (32 bit) as this is the one I know to support almost 100% of Vuforia). A note: this will NOT delete any Unity projects you have created, you will just need to reopen them in your new version of Unity.
Another solution is like what tim mentioned in his comment--to just have both 64bit and 32bit Unity installed of your computer. Just make sure that you stay as consistent as possible (i.e. make sure you don't accidentally open a Vuforia project with the 64bit Unity) as this will likely cause problems.
Best of luck.
If you want to use Unity 64 bit , you can try the newest version of Vuforia , vuforia-unity-6-0-112.It was recently released to be more compatible for unity 64 bit.You can give it a try by downloading on this link https://developer.vuforia.com/downloads/sdk. Right now im using Unity 5.4.0f3 (64-bit) and its working perfectly until now.

Application.LoadLevel() on Google Cardboard starting upside down

When restarting my Google Cardboard game with Application.LoadLevel(0); my Google Cardboard game starts upsidedown my my phone (fine in the editor but with error), and no input works on it (such as tap or pulling of the trigger).
When calling Application.LoadLevel(0); in the error it loads fine but gives this error:
Some objects were not cleaned up when closing the scene. (Did you spawn new Game Objects from OnDestroy?)
There's a bug in 0.4.10 when using Unity 4 Free that causes this. You can turn off the Native Distortion Correction option in the Inspector panel for CardboardMain. Alternatively, the bug is not there in 0.4.9, so you could use that version.

Does Google Cardboard SDK work with Unity 5?

I have converted my working project from Unity into Unity 5 and now the stereoscopic display doesnt work.
It seems like the stereoscopic effect doesnt work. The display is split in the middle, and the shader is applied, but it seems like there is only once camera. Like there are no eye cameras.
The weirdest thing is that everything works perfectly in the editor, but when I run it on device it seems like the cameras are disabled.
I went through and tried everything in the "known issues" in Cardboard SDK Release Notes, but nothing works.
Has anyone succesfully run a Cardboard game on Unity 5?
Yes, I have done. Mine isn't big one but has major things that can be said to be using UNITY features as well. I cant predict your problem as such but Answer to this post is certainly YES.
I don't think that anyone has posted this yet, but it appears that the SDK is currently broken in Unity 5.
From: Cardboard SDK Release Notes
Unity 5 rendering issues: As of Unity build 5.0.0f4, the following steps should be taken to fix or ameliorate any rendering issues, such as an all-black screen, flashing textures, or non-stereo views:
Enable the Development Build option in the Build dialog. This seems to fix various rendering glitches, like flashing textures.
The root cause of the rendering glitches is under analysis, with assistance from Unity.
I have also found that the app has rendering issues when it initially runs when you hit "Build and Run". Closing the app from the task switcher and restarting seems to resolve the issue.

Categories

Resources