i have been trying to work out the best way to set this up. I have 3 things that i would like to be able to click on. then when you click on each one id like a new window, or a new pop up to come up and have a list of options that you can select.
right now i have tried this code, but it is saying there are errors, and i am not quiet sure where i am missing the errors at.
using UnityEngine;
using System.Collections;
public class regionmenutest : MonoBehaviour
{
var plain : GameObject ;
var spawn_possition;
function Start ()
{
plain.GameObject.SetActive = false;
spawn_possition = Vector3 (0, 0, 0);
}
function Update ()
{
}
function OnMouseDown ()
{
plain.GameObject.SetActicve = true;
}
}
in my head i was thinking if i assigned the plain that was turned up to the game object in this code i could make it appear when something is clicked. not sure if i did this correctly though, or if there is a better way to do this. any thoughts would be awesome, thanks!
just looking for what the best way to set something like this up in unity would be. another thought was possibly having each one open a new scene and just building the buttons and upgrades etc. into each new scene and making a back button that sent the user back to my main scene of the game.
hmm, i fixed that and i am still getting a couple errors…
here is the code now
using UnityEngine;
using System.Collections;
public class regionmenutest : MonoBehaviour
{
var plain : GameObject;
var spawn_possition;
function Start ()
{
plain.GameObject.SetActive = false;
spawn_possition = Vector3 (0, 0, 0);
}
function Update ()
{
}
function OnMouseDown ()
{
plain.GameObject.SetActive = true;
}
}
You have to declare what the type is, there isn’t a way for the compiler to infer the type in a straight declaration. Plus, you’re mixing unityscript with csharp syntax.
instead of var, use the type like this:
public GameObject plain;
public Vector3 spawn_possition; // misspelled
yeah, i went through some classes for them, i am going to try to learn some more now. i did a basics course through that java and some others. thought i had it straight, but i guess not. thanks for the help. ill concentrate on just c # right now until i feel like i have that down solid.