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

C# Capture Keypress

$
0
0
So I'm making an rpg random Battle system an i would love o have my char enter a battle after walking so much my code is `using UnityEngine; using System.Collections; public class Battle : MonoBehaviour { void Start() { } int Steps; bool Go; void Counter() { Steps = Steps + 10; if (Steps == 100) { Go = true; } if (Go = true) { Application.LoadLevel("Battle1"); } } }` How do i make it so when i press KeyCode.UpArrow Left Right Or down Steps adds 1?

Viewing all articles
Browse latest Browse all 171066

Trending Articles



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