Rotating hitboxes?

Quick question… phaser docs seem not to have great info on this problem. How can you rotate a hitbox? My game has a cannon that revolves around a central circle, and the collision is rather iffy, due to the hitbox staying linear.

Also, as a side question, is it possible to have a sprite have two hitboxes? My cannon designs ( there are 63 of them ) all have different shapes, but they generally all have a circular body and a rectangular cannon.

Any advice would be great!
:bread:

Arcade Physics hitboxes don’t rotate; instead the body transfers its rotation to the parent sprite.

For rotating sprites sometimes a circular body with the right radius gives a good enough result. Or try Overlap process callback 2 example.

A sprite can have only one Arcade Physics body. You can put multiple physics-enabled sprites in a physics-enabled Container.

For more complex stuff you could use Box2D or Matter Physics.

1 Like