So i am making my own 2D physics using raycasts and its been working fine so far. But when i try to get information about the colliders i hit it gives me the wrong data.
hit = Physics2D.Raycast(new Vector2(x, y), new Vector2(0, dir), Mathf.Abs(deltaY + (dir * skin)), 1 << 11);
if (hit.collider != null)
{
Debug.Log(collider.transform.position.z + " " + collider.transform.localScale + " " + collider.gameObject.name);
So the Hit.collider returns my own 2D character, even though it has the wrong layermask and a disabled collider (wtf?).