## Try this.

### Obtaining the global position of a spatial

```
var posEnemy : Vector3 = (get_node("SpatialNode") as Spatial ).global_transform.origin
```

### saves the normalized position pointing towards that place.

```
var newPosition : Vector3 = global_transform.looking_at(posEnemy,Vector3.AXIS_Y).origin.normalized()
```

## Because normalization involves dividing by the length of the vector, you cannot normalize a vector of length 0. Attempting to do so will result in an error.

### I recommend that you use VScode to have a better autocompletion and reference to the classes.

```
func Transform.looking_at(target: Vector3, up: Vector3) -> Transform
Returns a copy of the transform rotated such that its -Z axis points towards the target position.
The transform will first be rotated around the given up vector, and then fully aligned to the target by a further rotation around an axis perpendicular to both the target and up vectors.
Operations take place in global space.
```