PolygonCollider2d rotation on gameobject in 3d environment.

Hi, i wonder if anyone could help.

I am adding features to a game I’m working on and this feature involves a mobile phone in the game which the character can make or receive calls, and messages.

However the phone is in 3D space parented to the Camera, which is in turn (the camera) is parented to the player and (the Phone) is situated just behind the player and in front of the camera. When the phone is summoned I just make it visible and a small sliding animation positions it just in front of the Camera.

The Icons are 2D and these have PolygonCollider2D to detect which Icon was pressed when the finger is over it.

Likewise the finger at it’s tip has a 2D Polygon collider. But as the character moves around the envorinment, making rotations on the Y axis, so does the Camera and in turn the phone which changes the PolygonCollider2D which do not seem to rotate with the Icons.

So when facing in one direction, it works perfectly but in other directions it does not. Is there a way to overcome this? Any suggestions would be appreciated.
A video of it in action:

It’s 2D physics not 3D physics so it cannot be rotated into 3D space. The only 3 degrees of freedom are XY position and Z rotation. If you rotate either XY axis then the result will still be a projection on the XY plane i.e. a BoxCollider2D “rotated” 90-degrees in the Y-axis results in it being edge-on and therefore no collider area in the XY plane.

Many thanks. It makes perfect sense. I thought there might be a workaround. I suppose I will use BoxColliders instead.

Thanks again for your answer.

I presume you mean the 3D physics BoxCollider because what I said applies to all 2D physics not being 3D physics.

Absolutely. 3D BoxCollider seems to work much better and currently no problems with it. Many, many thanks.