I am making a car game in unity 5.0.4f1. I am facing two snags.
- While installing 3.5 net framework, it gives an error. I searched, it took my 2hrs and problem couldn't solve. Then, I reinstalled Unity. For this snag, what is the best solution in a way I won't waste my time anymore?
- On the other hand, when I added a C# script using VS community 2015, after dragging the script on the click event, No function doesn't show me the script name in the drop down menu. I'm following this tutorial, tutorial link. At 7:58 he added the script in on function. For me, it is not working.
using UnityEngine;
using System.Collections;
public class LevelLoader : MonoBehaviour {
GameObject menu_Canvas;
GameObject settings_Canvas;
void Start () {
menu_Canvas = GameObject.Find ("MainMenu_Canvas");
settings_Canvas = GameObject.Find ("Settings_Canvas");
settings_Canvas.SetActive (false);
menu_Canvas.SetActive (true);
}
public void LoadLevel (int a) {
Application.LoadLevel (a);
}
public void Quit () {
Application.Quit ();
}
public void loadMenu () {
menu_Canvas.SetActive (true);
settings_Canvas.SetActive (false);
}
public void loadSettings () {
menu_Canvas.SetActive (false);
settings_Canvas.SetActive (true);
}
}
Please help, as I have been trapped in the problem since few days.
OnClick()
field? so you should attach it to gameObject so place it there. do you usepublic access modifier
in your code? \$\endgroup\$