Change Scene with Physics Raycasting
Hi, I'm completely new to Unity, and need help changing scene. Also I'm using c#.
I'm using the google cardboard sdk, and have physics recasting attached to the main head camera. I have a box collider attached to the object I want to click.
What I want to happen, is that when I click the object, a new scene will load. I tried to work it out by editing code I found on this forum but so far I haven't had any success.
This what I currently have.
Answer by Dead_Man2001 · May 14, 2016 at 11:04 PM
Right now, the raycast hit does not have any value to it. To add value, you need to do a raycast in an if statement. It should look something like this:
If (physics.raycast (//your position here, //your rotation here, out hit)){
If (hit.collider.isTrigger){
//the rest of the code here