public class BoardLocations : MonoBehaviour
{
public GameObject A1;
public class Coords
{
public Vector3 aOne = A1.transform.position;
}
}
This is all in one script, attached to an empty game object. The error I get is "An object reference is required for the non-static field, method or property 'BoardLocations.A1'". The only way to make the error go away is to make the GameObject and Vector3 static, but doing that means I can't see the GameObject in the inspector, which I need to assign the GameObject. Placing the GameObject in the same class as the Vector3 yields the same results. How can I reference the GameObject in the class so the Vector3 can see it?