'DistanceFromTarget' Does not exist in namespace 'PlayerCasting' (are you missing an assembly ref?)

Probably quite obvious

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;

public class DoorCellOpen : MonoBehaviour
{

public float TheDistance;
public GameObject ActionDisplay;
public GameObject ActionText;
public GameObject TheDoor;
public AudioSource CreakSound;

void Update()
{
TheDistance = PlayerCasting.DistanceFromTarget;
}

void OnMouseOver()
{
if (TheDistance <= 2)
{
ActionDisplay.SetActive(true);
ActionText.SetActive(true);
}
if (Input.GetButtonDown(“Action”))
{
if (TheDistance <= 2)
{
this.GetComponent().enabled = false;
ActionDisplay.SetActive(false);
ActionText.SetActive(false);
TheDoor.GetComponent().Play(“Hinge 1”);
CreakSound.Play();
}
}
}

void OnMouseExit()
{
ActionDisplay.SetActive(false);
ActionText.SetActive(false);
}
}

Yes, putting tags on your code is an obvious first step.

If you post a code snippet, ALWAYS USE CODE TAGS:

How to use code tags: https://discussions.unity.com/t/481379

Remember: NOBODY memorizes error codes. The error code is absolutely the least useful part of the error. It serves no purpose at all. Forget the error code. Put it out of your mind.

The important parts of an error message are:

  • the description of the error itself (google this; you are NEVER the first one!)
  • the file it occurred in (critical!)
  • the line number and character position (the two numbers in parentheses)

All of that information is in the actual error message and you must pay attention to it. Learn how to identify it instantly so you don’t have to stop your progress and fiddle around with the forum.

How to understand compiler and other errors and even fix them yourself:

https://discussions.unity.com/t/824586/8

EDIT: this is apparently the second time JUST THIS MORNING that you’re either unable or defiantly unwilling to format your code properly, despite being informed in another thread. This behavior is not likely to motivate people here to help you.

The reason I am asking is because despite trying to learn and looking for solutions I am still unable to do it…