why instantiation of the object no occur in the same position of the source ?

Hello
i am new to photon engine
i am trying to instantiate Cube in position of game empty prefab i added to the script in the editor
but Actually it isn't instantiated in the same position of empty game object
so ,what is wrong here ?
that is my code .

if (M_Player)
{
if (one)
{
PhotonNetwork.Instantiate(P1.name, Source_P1.transform.localPosition, Quaternion.identity, 0);
}
}
else
{
if (one)
{
PhotonNetwork.Instantiate(P1.name, Source_P2.transform.localPosition, Quaternion.identity, 0);
}
}


Comments

  • I am going to take a guess and say it is because you are using the localPosition of the source and not its global position (what is displayed in the inspector).
  • thanks so much
    Actually i solve it
    i was making the the sources is a child to a floor object in the scene
    what i did to solve the problem is to make the sources independent without being a child of any object
Sign In or Register to comment.