Oculus Builds Not Running(Crashing) - c#

I have made a unity physics based Jetski Game and am having trouble with getting it onto my Oculus Quest 2 and it actually working. For me I am stuck in a place that doesn't have good enough Wi-Fi to run air link and don't have the cable link. These has caused me to build it straight onto the headset itself. When running it on the headset the three loading dots would start playing its animation and never stop, but when you clicked the oculus button it would come up with the error "JetSki has stopped working." (JetSki is the game name.)
These are the tools that I am using and other information that may be needed:
How I set up the keystore: https://www.youtube.com/watch?v=qFS77pQ2VaQ
How I set up VR in unity: https://www.youtube.com/watch?v=HhtTtvBF5bI and https://www.youtube.com/watch?v=8PCNNro7Rt0
How I am getting the inputs:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.InputSystem;
public class InteractionInput : MonoBehaviour
{
public InputActionProperty triggerPress, triggerBool;
public InputActionProperty gripPress, gripBool;
[HideInInspector]
public float gripValue, triggerValue;
[HideInInspector]
public bool gripPressed, triggerPressed;
void Update()
{
triggerValue = triggerPress.action.ReadValue<float>();
triggerPressed = triggerBool.action.ReadValue<bool>();
gripValue = gripPress.action.ReadValue<float>();
gripPressed = gripBool.action.ReadValue<bool>();
}
}
How I am building the project:
I have searched everywhere and all I can find are random threads on stack overflow and unity forums. Yet these are talking about if it crashes when connected to a pc and none of those have helped. There is no one that I have found that is in this exact problem. After this searching I also tried to use the Side Quest to upload the .apk to my headset but I got another error: self signed certificate in certificate chain. Any tips or solutions would be greatly appreciated.
Thanks
Stan :)

Related

UnityEditor.BuildPlayerWindow+BuildMethodException: 3 errors (Deploying to WebGL)

So I am getting this error:
UnityEditor.BuildPlayerWindow+BuildMethodException: 3 errors
at UnityEditor.BuildPlayerWindow+DefaultBuildMethods.BuildPlayer (UnityEditor.BuildPlayerOptions options) [0x002cc] in <3371b3e2e5754acd87e600e068350da5>:0
at UnityEditor.BuildPlayerWindow.CallBuildMethods (System.Boolean askForBuildLocation, UnityEditor.BuildOptions defaultBuildOptions) [0x00080] in <3371b3e2e5754acd87e600e068350da5>:0
UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)
I've looked up the error on google but I am not getting any answers. The game is working just fine in unity editor.
The error says build Player a lot so I assumed it's a compiling error in building the player. I am using the Photon Player Scripts and their scripts for game manager. (Photon Voice 2, Photon Chat, Photon Fusion, Photon Realtime)
Anyways here is the script:
using UnityEngine;
using Photon.Pun;
public class GameManager : MonoBehaviour
{
public GameObject playerPrefab;
void Start()
{
PhotonNetwork.Instantiate(playerPrefab.name, new Vector3(Random.Range(-5f, 5f), Random.Range(3f, 5f), Random.Range(-5f, 5f)), playerPrefab.transform.rotation);
}
}
I have 2 Scenes: "Connect&Lobby" and second scene "Main"
Also, here are some of the errors above this error (But I'm sure these aren't causing the build problems):
Error building Player because scripts had compiler errors
Assets\Photon\PhotonVoice\Demos\DemoVoiceUI\Scripts\MicrophoneDropdownFiller.cs(110,28): error CS0103: The name 'Microphone' does not exist in the current context
I've been dealing with this issue for couple days now it's really annoying.
Also, the player script has no compiler errors pretty sure: (Take a look)
using UnityEngine;
using Photon.Pun;
using TMPro;
using UnityEngine.SceneManagement;
public class Player : MonoBehaviour
{
public PhotonView photonView;
public GameObject usernameCanvas;
public TMP_Text usernameText;
void Awake()
{
if (photonView.IsMine)
{
usernameText.text = PhotonNetwork.NickName;
}
else
{
usernameText.text = photonView.Owner.NickName;
}
}
void Update()
{
if (!photonView.IsMine)
{
usernameCanvas.SetActive(true);
}
}
}
Error The name 'Microphone' does not exist in the current context is the reason why you cannot build your project (at least, it is one of the reasons, perhaps, there are some more there)
According to the unity3d documentation, Microphone class is not supported in WebGL.
I saw this page but didn't test it myself. Anyway, you can give it a try =)
There is other problem with you pc or laptop some of security or vpn apps dont allow you to build your unity project just checkout your pc and build it again

"GameObject" not recognized

I just started learning c# for unity today and at my 3rd line of code I run into a problem:
My VSCode doesn't "recognize" the GameObject variable. The autocomplete menu doesnt show it and if I hard-write it, it doesnt get coloured.
Im following this tutorial and I dont wanna keep going without solving this.
Its worth clarifying that I didnt install anything other than VSCode and Unity 2019.3.2 and maybe I need a some extension?
Here's the code:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class NewBehaviourScript : MonoBehaviour
{
public int health = 5;
public float fhealth = 5.0;
public GameObject player;
}
Visual Studio Code normally doesnt autocomplete Classes if not installed with Unity Package Manager. So, if you dont have any compiler errors you could just continue without autocomplete.

Why is the Namespace "IUnityRenderPipeline" Suddenly Missing from the Vuforia Script?

I've been working in Unity the last month or so. I've gotten a few iterations of a basic AR application worked up but I've updated Unity and now my code is throwing all sorts of errors.
Last week my app was working fine when building to my Pixel phone. Now that I've updated to Unity 2018.3.9, Vuforia 8.1 is now missing the name space mentioned in the title. Does anyone have any information on this?
The app will play correctly if I restart Unity up until I try to build the application to the phone. Once I build and it fails I can't replay the application due to compiler errors.
I've typed in different namespaces in the Vuforia Script and have checked my script. Mine is the same script I've used in previous versions with zero issues. I have Vuforia in the namespace but the issue appears to be coming form the Vuforia inherent script instead.
Here's the section of the Vuforia Code that appears to have the most bugs:
\\\\
namespace Vuforia.UnityCompiled
{
public class RuntimeOpenSourceInitializer
{
static IUnityCompiledFacade sFacade;
[RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.BeforeSceneLoad)]
static void OnRuntimeMethodLoad()
{
InitializeFacade();
}
static void InitializeFacade()
{
if (sFacade != null) return;
sFacade = new OpenSourceUnityCompiledFacade();
UnityCompiledFacade.Instance = sFacade;
}
class OpenSourceUnityCompiledFacade : IUnityCompiledFacade
{
readonly IUnityRenderPipeline mUnityRenderPipeline = new UnityRenderPipeline();
public IUnityRenderPipeline UnityRenderPipeline
{
get { return mUnityRenderPipeline; }
}
}
class UnityRenderPipeline : IUnityRenderPipeline
{
public event Action<Camera[]> BeginFrameRendering;
public event Action<Camera> BeginCameraRendering;
public UnityRenderPipeline()
\\\\\
I'm not versed enough in C# to know the fine tunings of QC'ing the code other than the immediate lack of ";" in a lot of these lines.
What the app should be doing is building correctly to my phone. Once there it's an application that reads a sketch I drew, and shows a model or several renderings of the space based on the image target and virtual buttons placed in Unity.
Hello
Not sure how you created your app, but these errors look similar to ones you'd get if there was a mismatch between the Engine SDK version and the Vuforia samples. As the SDK evolves and APIs are created/changes, so do the samples to be compatible with them. Here's how you can check the versions of both (assuming you used Vuforia samples resources):
- SDK version: Unity Editor->Window->Vuforia Configuration.
- Samples version: Unity Editor->Project window: Assets/Vuforia/version.
also, you can delete the old version of Vuforia and re-import from the Package Manager in Unity.
Thanks,

Unity play video error `PlayVideo.audio' hides inherited member `UnityEngine.Component.audio'. Use the new keyword if hiding was intended [duplicate]

This question already has answers here:
Using new Unity VideoPlayer and VideoClip API to play video
(4 answers)
Closed 5 years ago.
using UnityEngine;
using System.Collections;
using UnityEngine.UI;
[RequireComponent (typeof(AudioSource))]
public class PlayVideo : MonoBehaviour {
public MovieTexture movie;
public AudioSource audio;
// Use this for initialization
void Start () {
GetComponent<RawImage> ().texture = movie as MovieTexture;
audio = GetComponent<AudioSource> ();
audio.clip = movie.audioClip;
movie.Play();
audio.Play();
}
this script is working when i play. But i get error when i buid for android apk. can i play the video in android device ?
MovieTexture is not supported on Android.
https://docs.unity3d.com/Manual/class-MovieTexture.html
There is the new VideoPlayer coming in 5.6.
https://docs.google.com/document/d/1gZa5z_jEEETDk8E_hbYXXjNhetRlM9eu8eTpbfMkRYY/edit
As for the warning, there was a time when all MonoBehaviour would get a set of reference for other scripts. Rigidbody, AudioSource, Transform,.. all of those Unity types. But it was removed and only Transform made it through the cut (most likely coz it is the only component sure to be found).
Despite the fact it was removed, it seems they forgot to totaly remove the references, so even though they are not available, the warning pops up (maybe the warning debug code check is still there while compiling even though the reference is not existing).
You can ignore, add a macros:
#pragma warning disable 0108
use a different naming or add a new keyword.
private new AudioSource audio;
EDIT: If you need to play video on Androir in 5.5 you can either use:
https://docs.unity3d.com/ScriptReference/Handheld.PlayFullScreenMovie.html
which will play full-screen. It basically pauses the Unity application, starts a new process of a video player that you can stop by tapping on the video. There is no further control and you cannot make the window smaller.
The other case is to purchase a plugin from the store. Just set a search for video texture and do your pick.
In this case, it will use a render texture to display the video content. So you can set the texture on a UI object or a world object.

BuildPipeline.BuildAssetBundles deprecated (Unity)

I am developing a scene in Unity that will feature augmented reality. I would like my 3D object to be loaded from an external server. I was following a youtube tutorial on how to do that and he uses this script:
using UnityEngine;
using System.Collections;
using UnityEditor;
public class CreateAssetBundles : MonoBehaviour
{
[MenuItem("Assets/Build AssetBundles")]
static void BuildAllAssetBundles()
{
BuildPipeline.BuildAssetBundles("Assets/AssetBundles");
}
}
However, BuildPipeline.BuildAssetBundles is said to be deprecated. There are added parameters which I have no idea what to put. This is my first time using Build Pipeline. How do I fix this? I tried asking in unityanswers but sadly noone was able to help me so I'm hoping that someone can help me here.

Categories