genco написавThis solves my problem. However, I want to know if there is a better way.
There are many ways in which cutting off limbs could be implemented.
A more complicated way would be to use the SkeletonUtilityBone
Create 2D Hinge Chain
or Create 3D Hinge Chain
button provided in the Inspector to generate a quick physics rig ahead of time that can be modified to your liking. Then you would start with the physics and the Override
being deactivated during normal play and then activate it when the body part should be cut off and the physics enabled. The location needs to be updated once before enabling it to provide a smooth transition.
Perhaps the easiest way would be to use the already existing SkeletonRagdoll example component. There you can set a starting bone which would be dissected then, and just have to call Apply
to enable the detachment and physics. If you need to dissect multiple limbs, you would need to adapt the script accordingly. You can find a demonstration of the SkeletonRagdoll2D
component in the example scene Spine Examples/Other Examples/SkeletonUtility Ragdoll
.