Quantcast
Channel: Questions in topic: "readable"
Viewing all articles
Browse latest Browse all 62

How to combine variables?

$
0
0
I'm building a 3D platformer, and I've got five raycasts from my character to check for the ground, and then to actually set the grounded variable, I'm checking for all of them using || like this if (centerFloorCheck || frontFloorCheck || rearFloorCheck || leftFloorCheck ||| rightFloorCheck) Is there any way to combine all of my raycast variables into one, so that if one is true, it returns true, so that I can just check for that single variable? P.S. I don't just want to do this if (center || front || rear || left || back) } anotherVariable = true; } else { anotherVariable = false; } Is there any good way to do this?

Viewing all articles
Browse latest Browse all 62

Trending Articles



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