I'm working on a 2D physics-based space game and ran into some issues.
Basically I'm looking for a way to destroy my RigidBody2D-Spaceship on impact.
I tried a few things and ended up connecting the four rocket parts with 2x3 pinjoints which are deleted on impact. (1 is attached to 2 with two joints (to stop rotation), 2 is attached to 3, and so on)
Everything works fine until I start turning my rocket more than about 360 degrees...
All the forces are applied on the lowest part of the breakable rocket.
Steering code looks like this, pretty basic:
if alive and fuel > 0:
applied_force = thrust.rotated(rotation)
applied_force = Vector2()
var rotation_dir = 0
rotation_dir += 1
rotation_dir -= 1
applied_torque = rotation_dir * torque
To have the rocket already exist of multiple parts seemed more straightforward to me than spawning the broken ship on impact and applying velocity and other forces on the individual parts. if you have another idea to implement a breaking ship I'd be happy to hear it :)