Search Unity

Scaling bones in a skeleton without also scaling child bones?

Discussion in 'Scripting' started by MrMagoo22, Jul 1, 2015.

  1. MrMagoo22

    MrMagoo22

    Joined:
    Apr 13, 2014
    Posts:
    12
    I've been trying to figure out a good way to get this working for about a week now and I'm not sure what to try next. Basically, I'm setting up a character customization feature which will allow the user to modify things like character height, leg length, arm length, etc. I wrote a script to read in the slider value and apply it to the appropriate bones on the model skeleton. However, the scaling is proving to be difficult to work with thanks to the heirarchy structure of the model's bones. If I want to scale the upper arm, the rest of the arm scales as well and I need to apply an inverse scale to all the children of the bone. Problem is, the system needs to daisy chain for all the sliders to work properly, I can't just override the previous value of any bone or I might lose a modification made by a previous slider. I tried deparenting and reparenting but it caused a continuous tiny fluctuation in scale in all bones affected which looked very odd.