- Изменено
How to remove animation from a certain bone?
Hello everyone! I do the separation of the limbs of the character from the skeleton and use the following code on the screenshot, the specified limbs are successfully separated, but continue to be animated, changing the checkboxes in SkeletonUtilityBone through which everything happens does not help, is there an opportunity to stop the animation?
Video:
If you have enabled following of position
, rotation
and scale
, then likely the movement comes from the parent of the GameObject. Note that SkeletonUtilityBone
in Override
mode overrides a Bone's local location, rotation and scale values. If you are attaching a Rigidbody
and want it to move relative to world space, you need to change the GameObject's Transform.parent
to null (or to your desired hop level Transform).
Harald написалIf you have enabled following of
position
,rotation
andscale
, then likely the movement comes from the parent of the GameObject. Note thatSkeletonUtilityBone
inOverride
mode overrides a Bone's local location, rotation and scale values. If you are attaching aRigidbody
and want it to move relative to world space, you need to change the GameObject'sTransform.parent
to null (or to your desired hop level Transform).
Thanks for the answer! I converted the parent of bone to null and it disappeared))) Maybe there are more adequate ways to separate a limb so that it then becomes a separate physical object?
It's not a completely trivial scenario unfortunately, given that a severed limb would mostly span at least two or even more bones (e.g. upper leg, lower leg, foot) and multiple attachments. Sometimes you want to render the whole skeleton in a single render pass (when all limbs are visible on screen), sometimes you would prefer the mesh to be split (when limbs are outside the screen and you don't want to render them). So it depends on your scenario, sometimes you might even be better off preparing simple Unity physics GameObject chains for each limb (without a Spine skeleton behind it), and then when severing the limb only hiding the respective attachments in the skeleton, and showing the prepared limb GameObjects.
You can also have a look at the Spine Examples/Other Examples/SkeletonUtility Ragdoll
scene to see a slightly different approach, with more direct scripting via the SkeletonRagdoll2D
example component instead of using multiple SkeletonUtilityBone
components.
Harald написалIt's not a completely trivial scenario unfortunately, given that a severed limb would mostly span at least two or even more bones (e.g. upper leg, lower leg, foot) and multiple attachments. Sometimes you want to render the whole skeleton in a single render pass (when all limbs are visible on screen), sometimes you would prefer the mesh to be split (when limbs are outside the screen and you don't want to render them). So it depends on your scenario, sometimes you might even be better off preparing simple Unity physics GameObject chains for each limb (without a Spine skeleton behind it), and then when severing the limb only hiding the respective attachments in the skeleton, and showing the prepared limb GameObjects.
You can also have a look at the
Spine Examples/Other Examples/SkeletonUtility Ragdoll
scene to see a slightly different approach, with more direct scripting via theSkeletonRagdoll2D
example component instead of using multipleSkeletonUtilityBone
components.
Thank you very much! I will try to do it according to the principle described in the examples
Glad it helped!