title: Unity error CS0236: A field initializer cannot reference the nonstatic field, method, or property `UnitySampleAssets._2D.Camera2DFollow.Characters'
body: <p>I realize that there are hundreds of pages relating to this error. I have however already looked at many of them and have been unable to find one that pertains to my particular issue, so if this is a duplicate thread I do appologize.  I am trying to modify the 2D camera script provided by unity to choose its "target" (the game object it follows) to whatever character the user selects.  I am new to C# so I don't really know too well how to deal with this error.  I posted the whole code just in case, but the error should likely be found within the first 10 lines or so </p>
  
  <pre><code>using UnityEngine;
  
  namespace UnitySampleAssets._2D
  {
  
      public class Camera2DFollow : MonoBehaviour
      {
          private string character = PlayerPrefs.GetString("Character")
          public Transform target = Transform.Find(character);
          public float damping = 1;
          public float lookAheadFactor = 3;
          public float lookAheadReturnSpeed = 0.5f;
          public float lookAheadMoveThreshold = 0.1f;
  
          private float offsetZ;
          private Vector3 lastTargetPosition;
          private Vector3 currentVelocity;
          private Vector3 lookAheadPos;
  
          // Use this for initialization
          private void Start()
          {
              lastTargetPosition = target.position;
              offsetZ = (transform.position - target.position).z;
              transform.parent = null;
          }
  
          // Update is called once per frame
          private void Update()
          {
  
              // only update lookahead pos if accelerating or changed direction
              float xMoveDelta = (target.position - lastTargetPosition).x;
  
              bool updateLookAheadTarget = Mathf.Abs(xMoveDelta) &gt;                    lookAheadMoveThreshold;
  
              if (updateLookAheadTarget)
              {
                  lookAheadPos =       lookAheadFactor*Vector3.right*Mathf.Sign(xMoveDelta);
              }
              else
              {
                  lookAheadPos = Vector3.MoveTowards(lookAheadPos, Vector3.zero, Time.deltaTime*lookAheadReturnSpeed);
              }
  
              Vector3 aheadTargetPos = target.position + lookAheadPos + Vector3.forward*offsetZ;
              Vector3 newPos = Vector3.SmoothDamp(transform.position, aheadTargetPos, ref currentVelocity, damping);
  
              transform.position = newPos;
  
              lastTargetPosition = target.position;
          }
      }
  }
  </code></pre>