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?