Hi,
Big fan of Unity. I work on the art and design side. Great respect for the code side.
Thx in advance, as per below.
- Simple Main Menu -
Trying to figure out how i can click on a specific text field in the Canvas, and have that load a specific scene.
I will have about 5 text fields that will take the player to distinct and separate scenes.
void Update ()
void Update()
Does there need to be a space between Update and ()
*Here’s what i’ve come up with, by scouring the forums.
Getting an error message:
Assets/ZFBrowser/Demo/GSmed3.cs(21,11): error CS1513: } expected
using UnityEngine;
using System.Collections;
using UnityEngine.SceneManagement;
public class GSmed3 : MonoBehaviour {
void Update () {
if (Input.GetMouseButtonDown(0))
{
RaycastHit hit;
Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition);
if (Physics.Raycast(ray, out hit, 100.0f))
{
//Replace this with whatever logic you want to use to validate the objects you want to click on
if(hit.collider.gameObject.tag == "Clickable")
{
SceneManager.LoadScene("BRxMeditation1");
}
}
}