- Home /
Bending an Armature with Programming
I have had this question for a long time, and I have looked over the forums and the internet and found nothing on the topic. So, my question is, is it possible to bend an armature in game with coding. This use for this is to make it so a character's upper torso rotates back 'n forth with the mouse as it goes up and down. If anyone has any clue how to do this or what I'm asking, could you please show me how or link me to a place that shows me how.
It will be much appreciated, Thanks!
Answer by Owen-Reynolds · Jan 17, 2015 at 11:07 PM
My armatures (from Max, blender ...) show up with the bones as just transforms, childed inside of each other (shoulder, upperLarm, lowerLarm ... .) Just find them the usual way, and change transform.localRotation
.
I can bend the armature fine when it is in edit mode, but the second you go into the "Play mode" the armature snaps back into place. I think I can solve it though, If it works I'll post the answer. Thanks for help!
The animation is setting the rotation as well -- the "winner" is whomever sets it last.
Assu$$anonymous$$g you have to also play the animation, use LateUpdate to hand-rotate. It specifically runs after animation. The legacy animation system has some examples.
Or, there's probably a way to "turn off" animation for those bones -- Add$$anonymous$$ixingTransform for the regular "Legacy" system.
Yeah, it was the fact that I needed to use LateUpdate to rotate the bones. I put a body mask on all the the bones except the chest and that seemed to work. Thanks for the help!
Your answer
Follow this Question
Related Questions
Multiple Cars not working 1 Answer
Can be mesh asset saved with an editable parameter? 0 Answers
Morph along the 4th dimension 1 Answer
Combining Skinned Meshes no animation 0 Answers