I saw this in someone’s code, here was the variable declaration with this in it:
private int groundMask = 1 << 8;
It was called later in a raycast2d if statement.
if (Physics2D.Raycast(new Vector2(_transform.position.x-0.1f,_transform.position.y), -Vector2.up, .26f, groundMask)
|| Physics2D.Raycast(new Vector2(_transform.position.x+0.1f,_transform.position.y), -Vector2.up, .26f, groundMask))
{
grounded = true;
jumps = 0;
}
else
{
grounded = false;
_rigidbody.AddForce(-Vector3.up * fallVel);
}
So what is it? What does it mean/do?
Thanks for the answer :)
– jeffreywarf