Sorry for taking a while to reply. I've finally had a chance to sit down on this again.
I understand how xform syntax works and I'm sure it works how I need it based off of trying it. But there is a problem with it and I want to make sure I understand this method.
How I was hoping it worked was: When using xform that it essentially makes the target of the node, it's (0,0,0) position in 3D space.
But that doesn't seem to be the case, as when I try to create a movement script based off where the node is in relation to the target, the node spazzes sometimes. I'm trying to understand exactly it works. I'm not the greatest with matrix math.
Here's my example code, no errors pop up, it's just not moving as expected. I'm trying to simply have t1 follow a controlled node/mesh staying 5 units away from it and only moving on the z axis.
func _process(delta):
var distance = t1.transform.origin.distance_to(t2.transform.origin)
var target = t1.global_transform.xform(t2.global_transform.origin)
print ("target = ", target.z)
print(distance)
if target.z > 0:
t1.transform.origin = t1.transform.origin.linear_interpolate(t1.transform.origin - (Vector3(0,0,distance) - Vector3(0,0,5)),delta)
if target.z < 0:
t1.transform.origin = t1.transform.origin.linear_interpolate(t1.transform.origin + (Vector3(0,0,distance) - Vector3(0,0,5)),delta)