Collision detection for specific sides

I am trying to create a 2,5D game in unity and I’m having some trouble with collision detection. I want to detect what side of a certain object the player is touching. This is specifically for the top side. I tried checking whether the player is above it or not, but this gave trouble when jumping into the objects. Currently I’m doing it with planes, but this only works for static objects. I need this detection for moveable objects.

Does anyone know what to do?

If you plane idea is working for you, just make the planes children of the moving object, and they will move with the object. A similer question was asked here in the last couple of weeks. I cannot find it (it looks like they don’t index Unity Answers for searching very often), but I think his working solution was to do a raycast and use the RaycastHit.normal to determine which side. Also if the method you have of detecting a collision gives you a Collision object, then you have access the ContactPoints of the collision which all have normals. Note a corner hit might give contacts on two sides.

As theory in my head but never tried, instead of planes, you could use a thin box collider attached to an empty game object. There would be one collider for each side, and all would be children of the moving object.