Quantcast
Channel: Questions in topic: "javascipt"
Viewing all articles
Browse latest Browse all 1875

How do I make it to go to a level after an axis has been held down after a certain length of time?

$
0
0
I don't mind if it's C# or JS, I've been stuck on this for a while now and need help! Much appreciated Here's the code that I have written myself using UnityEngine; using System.Collections; public class GreenHillsBanner : MonoBehaviour{ private bool m_isAxisInUse = false; private bool down = false; private bool up = true; void Update() { if(Input.GetAxis.Down("Triangle")){ m_isAxisInUse = true; down = true; up = false; } if(Input.GetAxis.Up("Triangle")){ m_isAxisInUse = false; down = false; up = true; } if(down = true){ yield(WaitForSeconds(3)) { if(down = true){ Application.LoadLevel("Green Hills"); } if(up = true) { Application.LoadLevel("SELECTMENU"); } } } } } I'd like to know how to improve/make this code work... thanks and much appreciated

Viewing all articles
Browse latest Browse all 1875

Trending Articles



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