Advertisement
Guest User

Untitled

a guest
Jul 1st, 2015
226
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.59 KB | None | 0 0
  1. using UnityEngine;
  2. using System.Collections;
  3.  
  4. public class Sync : MonoBehaviour {
  5.  
  6.     // Use this for initialization
  7.     void Start () {
  8.    
  9.     }
  10.    
  11.     // Update is called once per frame
  12.     void Update ()
  13.     {
  14.         GameObject soldier = GameObject.Find ("SoldierNPC");
  15.         if (soldier.networkView.isMine == true)
  16.         {
  17.             gameObject.transform.position = soldier.transform.position;
  18.             gameObject.transform.rotation = soldier.transform.rotation;
  19.         }
  20.         else
  21.         {
  22.             soldier.transform.position = gameObject.transform.position;
  23.             soldier.transform.rotation = gameObject.transform.rotation;
  24.         }
  25.    
  26.     }
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement