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

Comparing vector 3 locations

$
0
0
if(Input.GetButtonDown("up")){ //transform.position.currentPos.y = transform.position.currentPos.y+1; currentPos.y = currentPos.y+1; Debug.Log("currentPos"+ currentPos); Debug.Log("startPos" +startPos); if (currentPos.y != StartPos) { Debug.Log("after currentPos.y!= startPos condional "+currentPos); transform.position.y = transform.position.y+1; currentPos= this.transform.position; } else if(currentPos == startPos){ Debug.Log("yes"); currentPos= this.transform.position; } } I want to not allow my player to move up ones if the location they are moving to is the location of where startPos is. Javascript

Viewing all articles
Browse latest Browse all 1875

Trending Articles



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