Sorry to dumb things way down but what is the proper syntax for .set_global_transform
?
When I do:
func _ready():
var GT = .get_global_transform()
var zero = GT[0]
var one = GT[1]
var two = GT[2]
var three = GT[3]
print("Global Transform is ",GT)
print("X is ", zero)
print("Y is ", one)
print("Z is ", two)
print("Origin is ", three)
I get:
Global Transform is 1, 0, 0, 0, 1, 0, 0, 0, 1 - 0, 1.83918, 2.4662
X is (1, 0, 0)
Y is (0, 1, 0)
Z is (0, 0, 1)
Origin is (0, 1.83918, 2.4662)
https://docs.godotengine.org/en/latest/classes/class_transform.html#class-transform
^ Says:
Transform | Transform ( Vector3 x_axis, Vector3 y_axis, Vector3 z_axis, Vector3 origin )
So I thought I would write (if I hypothetically wanted to move a camera to the same place):
get_node("/root/Camera").set_global_transform(Transform (1, 0, 0), (0,1, 0), (0, 0, 1), (0, 1.83918, 2.4662))
But I get an error saying Expected ')' in expression
I can't find an example of someone actually using .set_global_transform
with a string of coordinates written.
It works if I just do :
get_node("/root/Camera").set_global_transform(GT)
But not if I enter the actual characters of GT
, either verbatim or in the syntax the docs say.