• Runtimes
  • Mode Override Still Following Parent

Hi,

I spawned hierarchy and selected a bone's mode as "override" and all checkboxes like "rotation", "position" are selected.
I can set position or rotation of bone manually. But if don't do anything, it still follows the animation. Is there anything I can do to make it completely independent.

One more question. Even if I succeed it, is there a way of resetting everything to initial state?

Thanks!

Related Discussions
...
  • تم التحرير

I assume you are using spine-unity.

genco wrote

I can set position or rotation of bone manually. But if don't do anything, it still follows the animation. Is there anything I can do to make it completely independent.

When using Override mode, the location of the Transform will be used for overwriting the bone location. The problem you have might have two reasons:
1) The bone is part of an IK chain and the IK chain determines it's location.
2) You are having a problem with normal behaviour of Transforms, staying in their local position in relation to its parent. So if you move the parent bone's Transform (via a SkeletonUtilityBone in Follow mode) and don't set the location of the Override bone's Transform, it will keep its position relative to the parent, just as it normally would as a Transform.

Thanks for the answer. I see the logic here.
My purpose is to break apart a slot/bone from the whole body and add physics to it.
So if a character is shot, a body part will be thrown away.
For now, how I do is that Bake animation and create a gameobject of desired body part. Then making the related slot attachment null, and throwing other gameobject from the same position and rotation. This solves my problem. However, I want to know if there is a better way.


Any ideas?

genco wrote

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.