Quantcast
Channel: Questions in topic: "attach"
Viewing all articles
Browse latest Browse all 168

Attaching an object to bone dynamically

$
0
0
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

Viewing all articles
Browse latest Browse all 168

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>