Quantcast
Viewing all articles
Browse latest Browse all 2383

While loop crashing in update but why not if statement?

Anybody able to tell me why this code immediately crashes when using a while loop, yet works fine with the if statement? void Update() {//Tracks players position. Script not attached to player object playerXPos = player.transform.position.x; playerZPos = player.transform.position.z; while (playerZPos > 0f) { print(playerZPos); } } The player's position can return to below 0.

Viewing all articles
Browse latest Browse all 2383

Trending Articles



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