system
1
|
|
|
 |
Attention |
Topic was automatically imported from the old Question2Answer platform. |
 |
Asked By |
Laimis |
Hello, I’m trying to get 3D camera’s Z coordinates, but godot only let’s me write this.
var cameraZ = get_parent_spatial().get_node("3D_Camera").get_camera_transform().translated()
Any feedback would be appriciated
system
2
|
|
|
 |
Reply From: |
Zylann |
To get the Z position, you can write this:
var camera_transform = get_parent_spatial().get_node("3D_Camera").get_camera_transform()
print(camera_transform.origin.z)
I’m not familiar with get_camera_transform
: https://docs.godotengine.org/en/stable/classes/class_camera.html#class-camera-method-get-camera-transform
This one apparently can’t be modified, so the only one you can modify is the node’s transform:
var camera = get_parent_spatial().get_node("3D_Camera")
camera.transform.origin.z += 10