- Home /
Character Born Position
Hello Everyone,
I need little help from you. I have a build as named "Main House" this main house create a character in every 3 minutes. How can i take Main House" position and use in my character position? I want to my character born near which build made him ?
Instantiate (KarakterTipi, Vector3(i * 2.0, 0, 0), Quaternion.identity);
yield WaitForSeconds (UretmeZamani);
Regards
Vincenzo
Answer by robinking · Jul 29, 2010 at 12:06 PM
One option is to attach such a spawn point as a child GameObject to your house. (Just use an empty gameobject as the spawnpoint.) You can move that to wherever you like near the house.
Include this at the top of your Main House script:
var SpawnPoint : GameObject;
... in order to expose the variable in the inspector, so you can assign it as the spawnpoint child object. Then your instantiate command will be:
Instantiate (KarakterTipi, SpawnPoint.transform.position, Quaternion.identity);
Answer by Ricardo · Jul 29, 2010 at 11:55 AM
The term you're interested on is spawn point. There are many questions and answers on the forums related to these, which cover what you're asking as well. You can also look at the 2D platform tutorial, which demonstrates exactly what you're asking for.