- Home /
Question by
florton · Dec 19, 2016 at 08:52 PM ·
rotationspriteshitboxpolygoncollider2d
Polygon2D colliders getting messed up by rotation
When I set Polygon2D colliders to my sprite prefabs they look fine
But when i rotate the sprites at runtime which i need to do. It totally messes up the collider mesh, and so the hit detection on my sprites is inaccurate.
go.transform.rotation = Camera.main.transform.rotation;
Edit: Alright from reading forums looks like rotating Polygon2D colliders is not supported.
This seems like a huge oversight to me. Is there anyway I can have a similar collider or something else that will accomplish the same thing with rotation?
I only need to rotate the object once at instantiation.
Second Edit: Alright I got it working with box colliders but this isn't ideal because of the inherent limitations with boxes. It seems like there should be a polygon 3d collider or at least a way to rotate polygon 2d.
Comment