Trouble setting up a vector 3.

I’m trying to create a vector3 variable that is equal to the position of a child object using this code:

			Transform doorPointPosition = 
            this.gameObject.transform.Find("DoorPointNorth");

			Vector3 doorPoint = (doorPointPosition.position);

DoorPointNorth is the name of the child that I’m trying to get the position of, so that I can use it as a vector3 position later.

For some reason I keep getting a Null reference error. I’ve checked through the code and the name I’ve specified for the transform.Find is definitely correct. What am I doing wrong here, and how could I fix it?

Any help would be appreciated, thanks.

Perhaps the object you’re looking for is not a child of “this”. I would suggest you use.

GameObject.Find("DoorPointNorth");