so i want to instantiate an object and place it on spesific position, but when i search on Answers, it comes up with Instantiate() function, it hinder me…
i tried to type Instantiate but no autocomplete, so i think does it ok to use?
and here’s the part of my code where i use to spawn my character from CharacterSelection scene…
function Awake () {
savedplayer = PlayerPrefs.GetInt("selectedplayer");
playerMale = GameObject.Find("Cube1_M");
playerFemale = GameObject.Find("testchar_F");
if(savedplayer == 0){
}
else if(savedplayer == 1){
playerMale.SetActive(true);
playerFemale.SetActive(false);
gameObject.AddComponent("PlayerStats");
}
else if(savedplayer == 2){
playerMale.SetActive(false);
playerFemale.SetActive(true);
gameObject.AddComponent("PlayerStats");
}
}
so i should change the playerMale.SetActive() and Female, to Instantiate(playerMale, Vector3(0,0,0), Quartenion.identity) ??
yeph, the first scene of mine was selection char, or customization.. ok thanks bompi88 !! u help me out, i'll try it ! :)
– Rgalaxy