I feel like this should be working, but I'm clearly not understanding something about
Here's what I put in for the variable after your explanation:
var distance2opponent = self.transform.origin.distance_to(get_node("/workspace/Player").transform.origin)
And although there is no errors right away, when I run the script it gives me an error saying: "
Invalid get index 'transform' (on base: 'null instance')"
The debugger says it now can't find my Player node.
This code is being put on a MeshInstance called "AI".
My "Player" is also a MeshInstance. Both of them are children under the Spatial root "workspace".
I don't know what I'd doing wrong.