- Home /
cardboard gazed at to load new scene
Hi we are using a cardboard rectacle script to load new scene:
If you roll over a hot spot lets load a new level: I am using the google cardboard script from their demo:
public void SetGazedAt(bool gazedAt) {
//GetComponent<Renderer>().material.color = gazedAt ? Color.green : Color.red;
If (gazedAt.GameObject.name == "hotSpotBalcony"){
Application.LoadLevel("balcony");
}
If (gazedAt.GameObject.name == "kitchenHotSpot"){
Application.LoadLevel("kitchen");
}
}
THANK YOU !
Comment
If => if (lower i on the front)
Application.LoadLevel => Scene$$anonymous$$anager.LoadScene
Huh?
gazedAt.GameObject.name?
gazedAt is a bool... and If is not capitalized. Please check out some tutorials on scripting.