So I’m making part of the original Legend of Zelda and I’m working on collisions. I want to get the this grey box to collide with the green box (and not be able to go into it). It works when I approach from the bottom, but when I approach from the left it doesn’t detect a collision until right after this point: I used the hitbox rectangles as the destination rectangles for these sprites, so I know they have to be intersecting when they visually intersect, but they do not. I am using the Rectangle.Intersects method to detect the intersection, then Rectangle.Intersect to get the rectangle of the intersection. Here’s some of the code where rightTop is the green rectangle and collidable is grey:

`public void CheckCollision(ICollidable collidable) { if (collidable.GetHitBox().X > maxX) { if (!rightOpen) { collidable.SetPosition(maxX, collidable.GetHitBox().Y); collidable.BorderCollision(); } else if (rightTop.Intersects(collidable.GetHitBox())) { Rectangle intersection = Rectangle.Intersect(rightTop, collidable.GetHitBox()); if (intersection.Width > intersection.Height) { collidable.SetPosition(collidable.GetHitBox().X, rightTop.Bottom); } else if (intersection.Height > intersection.Width) { collidable.SetPosition(rightTop.Left-collidable.GetHitBox().Width, collidable.GetHitBox().Y); } else { collidable.SetPosition(rightTop.X, collidable.GetHitBox().Y); } } } } `