After adding a rigged model to my game, I’m having some Instantiate problems. For example, bombs. What I believe happens is I tell it to spawn at the location of the spawn point, which is actually a child of the character’s hand bone, and it spawns at that same location, but globally instead of relative to the parent’s location.
var bombStash : Transform[];
var spawnPoint;
function Update ()
{
for(var i = 0; i < bombCount; i++)
{
bombStash[i] = bombPrefab;
}
if(Input.GetButtonDown("Drop Bomb"))
{
bombCount--;
spawnPoint = gameObject.Find("BombSpawn");
var bomb = Instantiate(bombStash[0], spawnPoint.position, spawnPoint.rotation);
}