Get tail end of armature bone with script
I'm trying to find the other end (not the origin) of a bone imported from blender, so I can place an item in my character rig's hand. I tried boneTransform.TransformPoint(1, 1, 1)
but that doesn't appear to be in the correct place. How can I do this?
Answer by clabe45 · Jul 04, 2018 at 12:52 AM
Okay, my transform was rotated in just a way that transforming the point (-1, 0, 0)
returned the end point of the bone. This was because the blender import rotated it 90 degrees around the x-axis along with a bunch of other rotations from rigging. I looked at the red, green and blue arrows and eyed that translating along the x-axis was what I wanted, though there is probably a better programmatic way that I'm missing. And forget (1, 1, 1)
, it's really (0, 0, -1)
(forward) but then skewed by the rotations of the transform.
Your answer
Follow this Question
Related Questions
Problem with Character positions. Snapping to new child object. 0 Answers
When hitting border teleport bullet to player. 1 Answer
Move Single Bone With Script? 0 Answers
Obtain a Transform using RayCastAll without a Collision (ie a point in space) 2 Answers
Rotating single axis like the same axis of an other gameobject 0 Answers