How Do I Refer the origin point in C#?

i want to refer the origin point of a cloned prefab, so i can compare the distance between the actual point, and the origin point, so if it is more than the range, it will be destroyed…

do i need to create a null gameObject?

i’m thinkng of something like

{
range=500
deltaDistance=(origin.x-actual.x)+(origin.z-actual.z)+(origin.y-actual.y)
if (DeltaDistance >= range)
 destroy(*ThisObject*)
}

You’ll have to store the original position as a global variable using the Vector3 type.

Something like this in your Start function should work:

Vector3 origin;

void Start() {
origin = transform.position;
}