Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void Instantiate_Empty(){
- GameObject my_instantiate = Instantiate (my_instantiate_prefab, new Vector3 (0, 0, 0), Quaternion.identity)as GameObject;
- my_instantiate.transform.SetParent (my_parent.transform);
- NetworkServer.Spawn (my_instantiate); //How can i change transform of this spawn object?
- if (NetworkServer.active) {
- //Here i reference the position , rotation and parent to send it if im a client or if im the server
- Rpc_Instanciate_Empty (new Vector3 (-0.019f,0.006f,-0.0878f), new Vector3 (-24.8839f,-180f,90f),my_instantiate,my_parent);
- } else if (!NetworkServer.active) { //if i'm client
- Cmd_Instanciate_Empty_Mains (new Vector3 (-0.019f,0.006f,-0.0878f),new Vector3 (-24.8839f,-180f,90f),my_instantiate,my_parent);
- }
- }
- Void Rpc_Instantiate_Empty(Vector3 localpos ,Vector3 localrot,GameObject my_instantiate,GameObject my_parent){
- my_instantiate.transform.parent = my_parent.transform; //This doesnt work , i dont know how change transform of the spawn object
- my_instantiate.transform.localPosition = localpos;//Here too
- my_instantiate.transform.localEulerAngles = localrot;//Here too
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement