Quantcast
Channel: Questions in topic: "positive"
Viewing all articles
Browse latest Browse all 16

Checking number against boolean

$
0
0
So this works fine… var direction.x = Input.GetAxis("Horizontal"); if (direction.x) // direction is a positive value else // direction is a negative value . But the following doesn't validate. Is it not possible to compare a number with a bool in this manner? var userSetting : bool; if (direction.x == userSetting) // Both values are either negative or positive . // Edit: What I'm trying to do is check whether player is facing the correct direction to grab onto a ledge (Designer sets the ledge side manually) so player cannot grab a ledge with his back.

Viewing all articles
Browse latest Browse all 16

Trending Articles



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