Hi,
I have a script (called orbitTank) with the following code:
public override void
OnStartLocalPlayer()
{
Debug.Log(“Hi!”);
GetComponent().setTarget(gameObject.transform);
}
The debug log is definitely printed it out. However, I still get the error, that:

The script I am trying to modify is called Orbit, which contains the following code:
using UnityEngine;
using System.Collections;
public class Orbit : MonoBehaviour
{
public float turnSpeed = 4.0f;
public Transform playerTransform;
private Vector3 offset;
private Vector3 offset2;
void Start()
{
offset = new Vector3(0, 2.5f, 6);
}
void LateUpdate()
{
//if (playerTransform == null) return;
{
offset = Quaternion.AngleAxis(Input.GetAxis("Mouse X") * turnSpeed, Vector3.up) * offset;
transform.position = playerTransform.position + offset;
transform.LookAt(playerTransform.position);
}
}
public void setTarget(Transform target)
{
playerTransform = target;
}
}
I’m not sure why this isn’t working. Is anybody able to help?