- Home /
BoxCast always hits..?
Hi, I'm stuck on this line of code for two weeks. I've tried countless methods. It always returns true...
if(Physics2D.BoxCast(charEdgeRight.transform.position, new Vector2(0.2f, 0.46f), 0, Vector2.right, 0.01f, 11)) ;
{
BuildWall();
}
Thanks.
Comment
Well, check what it's hitting then:
RaycastHit2D hit = Physics2D.BoxCast (charEdgeRight.transform.position, new Vector2 (0.2f, 0.46f), 0, Vector2.right, 0.01f, 11);
if (hit)
{
Debug.Log("BoxCast hit: " + hit.collider.name);
}