Currently, I have integrated a sword model into the camera using the command camera.add(sword)
. However, I am facing difficulty in copying the position and quaternion of the sword to a cannon.js body. I attempted to add the cannon.js body to another body that is simulating the player's hitbox with the code cubeBody2.addBody(swordBody)
, but it ended up causing issues where the game broke and the canvas turned white. Any suggestions on how I can achieve this without encountering these problems?