in my game i have a ninja who needs to draw his sword. I have an animation that the ninja reaches up to take the sword of his back. (this is attached to a trigger around the handle of the sword that the hand goes threw)
var sword : Transform;
var arm : Transform;
function OnTriggerEnter (hit : Collider)
{
if(hit.CompareTag("attack arm"))
{
sword.transform.parent = arm.transform;
}
}
but when i play the game and the ninja reaches up nothing happens. i don't get any errors but it still doesn't work. Any ideas?
At this point you should have a trigger on the hand and the hilt of the sword. You need to put a kinematic rigidbody on the hand. According to the collision matrix in the reference manual, a static trigger will send a message to a kinematic trigger.
– Peter_G