- Home /
How to conserve momentum when breaking apart a rotating 2D object?
First of all, just to be clear: Working in 2D.
Here's what I'm trying to do: I want a 2D hexagon that's made up of several triangles to rotate in the air. When a script tells it to, I want the hexagon to break apart and the triangles to fly off according to the force and torque they had while they were still connected. This last part is giving me problems.
My first thought was to have a rotating empty gameobject and then attach the triangles to it with Fixed Joints. A script would then destroy the joints when I wanted it to. However, since there are no Fixed Joints for 2D Rigidbodies yet, I have to come up with a different solution.
I tried parenting the triangles to a rotating gameobject and then setting the parent =null
via script, but that does not retain the momentum; the triangles just stop dead. Hinge joints don't work as they don't seem to transfer the rotation of the empty object to the triangles.
I know that I could just use regular 3D Rigidbodies, but that would require a lot of code changes since so far the entire game has been built in 2D. Can anyone point me in the right direction?