- Home /
Manually set transform on certain bones in skinnedmeshrenderer
I have an animated model and I'd like to make the character be able to point in any given direction (maybe using something like transform.forward).
What I've done is created an arm outstretched 'animation' to the model and applied a mixingtransform to the arm so I can play any animation and then play the 'point' animation so whatever his animation is he can point.
The issue is that he only points forwards and despite trying to add rotations to the root arm transform nothing works, the skinned mesh renderer seems to outrank it.
So any ideas how I can do this?
I believe it should be possible, but I've not pulled this one off yet myself.. if you do figure it out, be sure to pass on any pointers! but I can at least offer an easy alternative:
http://docs.unity3d.com/Documentation/$$anonymous$$anual/AnimationScripting.html
look at the Additive example..
you can create an animation for "left point" and "right point", and use the animation.normalizedTime of the animation to set the "x value" of your direction to point..
now repeat the whole thing with an "up" and "down" point anim as well.. you can set these each individually, to wind up with your dynamic direction!
Answer by Meater6 · Feb 12, 2013 at 01:56 PM
Take a look at this:
http://answers.unity3d.com/questions/327196/rotating-a-bone-via-scripts.html
May be what your looking for...
Sorry for being so late, but better late than never! ;)