I keep getting the following error when trying to use the SetParent method in the code below:
using UnityEngine;
using System.Collections;
public class NetworkedPlayer : Photon.MonoBehaviour
{
public GameObject avatar;
public Transform playerGlobal;
public Transform playerLocal;
void Start ()
{
Debug.Log("i'm instantiated");
if (photonView.isMine)
{
Debug.Log("player is mine");
playerGlobal = GameObject.Find("OVRPlayerController").transform;
playerLocal = playerGlobal.Find("OVRCameraRig/TrackingSpace/CenterEyeAnchor");
this.transform.SetParent(playerLocal);
this.transform.localPosition = Vector3.zero;
// avatar.SetActive(false);
}
}