Example #1
0
    void Start ()
    {
        targetPos = target.position + Vector3.up * distance;
        transform.position = targetPos;

        pig = target.GetComponent<ThirdPersonPig>();
    }
 void OnDisable()
 {
     instance = null;
 }
 //singleton logic
 void OnEnable()
 {
     instance = this;
 }