Quantcast
Channel: Latest Questions on Unity Answers
Viewing all articles
Browse latest Browse all 171066

How to make a simple menu button with C Sharp

$
0
0
Hi, I'm very new to unity and coding and I have to make a simple game for my uni course. All I want is a to make a button on the main menu that when clicked will load the level. I've made the menu screen with a "Start" text (I think I made it a 3D text, not GUI) and this is the script I've got so far that I've managed to jumble together from looking at other online sources but it doesn't work: using UnityEngine; using System.Collections; public class ButtonScript: MonoBehaviour { public bool isQuit = false; void OnMouseDown () { if(isQuit) { Application.Quit (); } else { Application.LoadLevel ("flyinglevel"); } } } Any help would be greatly appreciated Thanks Chris

Viewing all articles
Browse latest Browse all 171066


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>