this returns 3, all the hitBuffer_.transform.name return the same object name, a single empty Gameobject with only a box collider I made just to test it_ but this csharp*_ <em>*count = collisionRigidBody.Cast(new Vector2(0, 0), deathCheckHitBoxFilter, hitBuffer);*</em> _* returns 1 and again the single hitBuffer_.transform.name give the same object So now what is the difference?? The first RigidBody is attached to the player The collisionRigidBody is attached to a gameObject that is a child of the player The code looks like this and the results come from the first frame of the game ```csharp_ *int count = 0;
count = myRigidBody.Cast(new Vector2(0, 0), deathCheckHitBoxFilter, hitBuffer);
print("Check for death Count is " + count);
for (int i = 0; i < count; i++)
{
print(hitBuffer[i].transform.name);
}*</em></em></em>
Do you have 3 colliders on the first Rigidbody2D and only 1 on the second? The docs make it sound like it separately casts each individual collider on the Rigidbody2D in the direction you specify.
As above but also why are you using a degenerate direction of 0? This is like devs who do raycast with zero direction instead of OverlapPoint which is super fast compared to casting.
If you want to check overlaps for colliders either individually or all attached to a Rigidbody2D then use OverlapCollider.
No only one but I have 2 children with only Box Colliders on them so the cast must have taken them, I manged to solve it by adding static RigidBodies to the other children