Object reference is required for the non-static field method or property
Class from which I trying to get data
public class Camera_movement : MonoBehaviour {
public GameObject player;
public Vector3 positionen;
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update () {
Virtual_PST();
}
public void Virtual_PST()
{
positionen = player.transform.position; //getting position of player
Debug.Log(positionen);
}
}
Class where I try to recieve data
public class PositionCalcView : MonoBehaviour
{
private string posText;
private Vector3 playerPos2;
public Color textColor = Color.white;
void LateUpdate()
{
playerPos2 = Camera_movement.Virtual_PST(); // !!!Here ERROR!!!
posText = string.Format(DISPLAY_TEXT_FORMAT, playerPos2);
}