When I install apk on android, one scene is black. How to fix it? - unity3d

So, I made my game for Android device and I've got a menu, store, info scene and a main scene. The main scene is where I play the game. But when I hit start on the menu it loads the "MainScene" and all I can see is the GUI but nothing else. I can collect items but the scene is just black (except the GUI).
I tested out with a web player and everything was fine then changed to Android and after I installed it (several times) I looked at the black screen.
How to fix this?
(I'm using Unity 4.6.1)

Can't comment, not enough rep.
Anyway, there are lot of things that can cause a black screen to happen on Android. Here are a few to look at -
Be sure your camera is not getting deactivated (in your case maybe not).
Are you using any plugin that is using alpha channel or stencil buffer?
Any other plugin that may causing this, disable them to check.
Is your 24/32 bit buffer ticked/not on build settings?
Double check your camera settings, lighting.
Stripping level to disable and rendering path on build settings etc.
Check the game on another device.
Provide more info about the scene here
There's definitely something on that specific scene.

Related

Scene freezes but game continues at back

I'm using 2020.3.15f2 at my project. Not regularly, but sometimes game freezes visually on mobile phone. I mean that moment is always on the scene even you change to different scene. You can click everywhere, also ads are coming too. There is no sign of error on profiler or XCode.
I've tried canvas with screen space camera, and I'm just rendering a changing text with a camera. It still doesn't change. So rendering is not the main problem here I guess. I did'nt find any release notes about it. Do you know what is the issue or what is the version with fix to that problem?

Google VR SDK stuck in portrait mode

I've built the app and compiled it with VR enabled and cardboard selected as my VR device. I can install and run it on my phone (Samsung S8) BUT the in game camera is stuck in portrait mode and the yew is inverted (turning my head left turns the camera right). I have scoured the internet but still can't find a way to fix this.
I've enabled VR in playersettings and added google cardboard as my VR.
I've also disabled portrait views under orientation.
I've set the camera as both a child and parent object.
I've built the app with both cardboard and daydream selected as the VR (and each individually) but still the same issue.
I've tried forcing different higher levels of API requirement
I have added and removed GvrEditorEmulator from the project and the GvrControllerMain and no luck.
I've even flipped the camera manually by a 180 degrees and this made the view be in landscape but in this case the pitch was inverted (when I look up the camera looks down) and I haven't found a way to resolve this.
In the editor view the screen looks fine, but every time I run it on my Android phone it force starts in portrait mode and the pitch or yew is inverted.
Is there a hidden option I need to switch, does anybody have more suggestions that I could try?
You can see what the app looks like when I hold the phone i portrait mode on the link bellow (the image breaks when I try to add it to the post for some reason).
https://imgur.com/a/o80NRe4
Its worth mentioning that I'm working with Unity version 2019 2.0b2 because any other version I tried would not detect my installed Android SDK and would not let me build the project. I've tried on multiple machines and always had that problem so I'm afraid of attempting an upgrade to a newer version would break my build ability.
This seems to be a known and reported issue for Google VR SDK for unity. Its been reported on their github page.
The only possible fix is reverting back to Unity 2018.3.14f1. I did this by exporting my v2019 project, then creating a new 2018.3.14f1 version project and importing the original into it. This rebuilds the project and should avoid conflicts if you're lucky.

How to remove unity build-in loading screen in Facebook instant game?

I am working Facebook instant game using unity2017.2. I deployed build for Facebook and uploaded it on Facebook. Everything is fine but when instant game start there is unity loading bar appears which take 8,9 seconds even if you have just one scene with one button in your game. So how can i remove that build-in unity loading screen. Please help. Thanks
https://i.stack.imgur.com/0IodM.png
It is not possible to skip the whole loading screen. As mentioned in the comments you can modify your UnityLoader.js - you can find this script in the Build folder of your build.
To read the code I recommend this beautifier
I just opend my build and found the object Progress in line 1849. Perhaps you have a different version and it is at a different line. Search for Progress
Here you can see what Unity is doing. In the Progress.update they are updating the ProgressBar.
At all it is not easy to read.
The easy way to customize you loading screen is to replace the graphics under TemplateData - here you can copy your own pictures. The names have to be the same as the original filenames: (default is light)
progressLogo.Light.png
progressFull.Light.png
progressEmpty.Light.png
I think this could be a solution for you?
Yup, it's a little bit frustrating to see a logo for a long time. I've worked on Unity version 2018.31f, and there, it's easily removable if you are using Unity Pro.
To remove the logo in Unity Pro, open your Unity WebGL project, Go to File -> Build Settings -> Player settings. You'll see settings for WebGL and a Splash Image column in that window, as shown in this picture.
As you can see in Splash Image settings, show splash screen column is inaccessible for me to tick/untick. The same goes with Show Unity Logo. This is because I'm currently using a free version of Unity. But in the Unity Pro version, you can untick this option and make that Unity Logo screen hidden.
If you are using the Unity free version, ensure a minimum Logo Duration of 2-sec, at least in the accessible version of Unity.

Switch to fullscreen

I started programming with the Google Cardboard v0.6 about a year ago. I really nailed what I was trying to do with this software. The problem is, my software requires a toggle between full screen and stereo screen modes which I have applied a canvas button for. It is also supposed to start in full screen with an option of stereo mode.
I have three questions:
With the new SDK, is it possible to script a stereo to full screen toggle routine?
I noticed they make the GoogleVR as a fixed SDK mount within the build settings. I read something along the lines of widget controls within the Android SDK but I'm not to savvy with the way Android Studio reads the APK and how to modify it. Honestly, I'm running Visual Studio with a Source Control library in TFS so I want to keep it out of Android Studio as much as possible.
I also read there is supposed to be a full screen toggle button programmed directly into the SDK but it just doesn't pop up on my screen. Perhaps there's a method of making this button pop up that will save the day?
Even if the button exists, if there is a toggle button I'd love to have the script reference so I can apply it On Start in order to start in full screen mode.
Will toggling full screen reactivate screen canvases?
I know the new GoogleVR does not allow canvases because they have a RenderTexture problem. I'm not too concerned because I'm going to make the Toggle button freeze if no control device is registered to the bluetooth, and if there is I have a button on the control device that returns to full screen (or hopefully with that magical screen button that should exist). Whether I can toggle between the two settings is not going to make a difference if it still doesn't allow for Canvases in full screen.
My greatest frustration right now is with the discontinuation of the scripts on build. I've been using the GVRViewer and such which work just like the V0.6 software, but it appears to completely negate these scripts on build and force the build to use the SDK. I've read in the release notes that at the moment they have no intention of returning to the v0.6 platform and even recommend rolling it back to v0.6 if this is the case, but honestly - if we are forced to use an antiquated version of the software, how long will it be before it gets phased out? In my opinion based on my current observations, this feels a lot like a "one step forward, two steps back" situation.

GoogleVR 1.0.1: stereo cameras are OK in the Unity Game View but too separated when compiled to Android

I'd say the value I have to change is the stereoMultiplier of the StereoController script attached to the main camera. Anyway I think I have changed every single value of GvrViewer, MainCamera and StereoController. Nothing seems to change the separation of the left and right cameras when compiled to the Android smartphone.
I can see a correct separation in the Unity Game View, but when I compile it to the smartphone, the cameras are too separated (see image below).
I think this issue has happened after updating the Smartphone to Android 6.0 Marshmallow (CyanogenMod 13.0), on Samsung S4.
UPDATE: I have updated to GoogleVR 1.0.1. The same problem is still happening.
Changing scale to 0.007 (which is a very similar scale to the objects in the provided demo scene of GoogleVR: 0.003) seems to fix the problem.
Note: discussed here: https://github.com/googlevr/gvr-unity-sdk/issues/351
UPDATE: in the previous link, somebody wrote:
Android app:
/sdcard/Cardboard/current_device_params
all gvr(cardboard) app will use this file --- "current_device_params".
maybe you should go the url to setup your device profile https://vr.google.com/cardboard/viewerprofilegenerator/
in addiation, you can also do this:
How to change Field of View in Google VR SDK for Unity