- Home /
Camera preview renders but game view doesn't onclick
It all works except it doesn't get triggered in Run mode.
My script
using UnityEngine;
using UnityEngine.UI;
public class ChangeSkybox : MonoBehaviour
{
public Material Laon;
public Material skybox_pano;
public Material Bedna;
public void ChangeSkybox1()
{
Camera.main.GetComponent<Skybox> ().material = skybox_pano;
}
public void ChangeSkybox2()
{
Camera.main.GetComponent<Skybox>().material = Laon;
}
public void ChangeSkybox3()
{
Camera.main.GetComponent<Skybox>().material = Bedna;
}
}
Here you can see what I mean https://imgur.com/Wzw2p92
I have the functions attached to the button through the onclick
This website is pretty useless. I hardly ever get any answer. Why they don't just move it to StackOverflow.
How many cameras are used in the scene? It must be 2 at least, for the eyes. But since it's two eyes and a single preview render, I would say there's 3 and you're changing only one background, which is rendered first
I use only 1 camera. But I solved the problem with updating Google VR.
Answer by guliverkel · Sep 14, 2017 at 12:41 PM
I figured this out. I used the older version of GoogleVR SDK. I updated it to the newer and that fixed the problem. I wish Unity had some update detection and notify me when these packages are old.
Your answer
Follow this Question
Related Questions
Any way to show a picture on the screen when a model is clicked? 2 Answers
Audio.PlayOneShot Doesn't Work 2 Answers
Custom Event Handler in Inspector? 3 Answers
UI Button not working 2 Answers