I have two empty game objects attached to my character, one on the hip and one on the hand and I have a gun which is attached to the empty game object on the leg and I want to change the position of the gun and set it to the empty game object which is attached to the hand so when I press the K key the guns appears in the hand. How can i do this?
I have tried this
var gun : Transform;
function update ()
{
var gun = Instantiate (gun, transform.Find("SpawnPoint2").transform.position, Quaternion.identity);
}
This script is just instantiating the gun at spawn point 2 and the gun just stays there, I want the 1 gun which is already in the scene to change its position and show up at spawn point 2 and attach it to the hand. Thanks