- Home /
Question by
Hardstop · Jul 11, 2014 at 10:36 PM ·
objectboneattachdynamically
Attaching an object to bone dynamically
Here's the code:
public var weapon:GameObject;
public var weaponBone:Transform;
function Start ()
{
// instantiate the weapon prefab
var weaponTransform:Transform = Instantiate(weapon, weaponBone.position, weaponBone.rotation) as Transform;
// make the bone a parent of the weapon
weaponTransform.parent = weaponBone;
}
My question is how i can set the hand bone to that "weaponBone" dynamically, because my player spawns not stands in the world already. Thanks in advance
Comment
Your answer
Follow this Question
Related Questions
Attach object to avatar bone 1 Answer
How to make weapon follow player arm when player model has been merged into one mesh? 1 Answer
get the bone position of the skeleton character and attach something to that bone position 1 Answer
How to have an object attach to my player when collided 2 Answers
Animated object changes position when animation is played. 1 Answer