Quantcast
Channel: Answers by "Graham-Dunnett"
Viewing all articles
Browse latest Browse all 959

Answer by Graham Dunnett

$
0
0
This is how I'd do it. I think your variable called `currentFrame` is actually the position in the X axis. public float framesX = 6; public float framesY = 6; private float currentX = 0; private float currentY = 0; void Update () { if (Input.GetButtonDown("Fire1")){ currentX += 1; if (currentX == framesX) { // stepped off right side currentX = 0; currentY += 1; if (currentY == framesY) { // stepped off top edge currentY = 0; } } } // now do something with currentX and currentY }

Viewing all articles
Browse latest Browse all 959

Trending Articles



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