A potential solution for Arcade Physics body that do not rotate with GameObject
You can watch how this example was created here: https://www.youtube.com/watch?v=akgFNu60Kv4
Some code clean-up was added after the video ended that shows how it can work in both scenarios of having the circle physics body as part of the Container or as part of the Scene.
You can toggle the different cases in SwordContainer.ts
by changing containPhysicsObject
.
This is a potential solution to a problem discussed on the Phaser Discourse: https://phaser.discourse.group/t/workaround-for-rotation-on-arcade-physics/5763/6
Demo: https://ourcade.github.io/phaser3-sword-rotation-arcade-physics/
This example project uses the phaser3-parcel-template and requires Parcel.
npm install
npm run start
Running at http://localhost:8000
The sword graphic used in this example is by Kenney.nl.