Question by 
               yigitxber · Aug 26, 2021 at 10:51 PM · 
                instantiatepositioninstantiate prefabspawning problemsinstancing  
              
 
              Instantiate wrong position
Normally,it's perfectly working fine but when I press the button, it always spawns at (0,0,0)
 public void Spawn()
     {
         if(teamID==Player.teamdID){
         Instantiate(Soldiers[0],transform.GetChild(0).gameObject.transform.position,Quaternion.identity);
         Soldiers[0].GetComponent<UnitPlayer>().unitdataplayer.teamdID=teamID;
         
         }
         else
         {
             Instantiate(Soldiers[0],transform.GetChild(0).gameObject.transform.position,Quaternion.identity);
             Soldiers[0].GetComponent<Unit>().unitdata.teamdID=teamID;
         }
 
              
               Comment
              
 
               
              Your answer