Confused about global/local 3D data

Godot Version



Hi there,
I have a Node3D with Rigidbody3D in position (0,5,0) and a script just doing this:

func _process(_delta):

this always prints (0,5,0) even the object is falling…

is it something I am missing?

Thanks in advance

Best regards

i assume this is on rigidbody3d? and the rigidbody3d is the one falling?

Is a scene with a Node3D/RigidBody3D, the whole node is physically falling down, but the global position never changes, the position.y value should be decreasing as it falls… right? I tried the same with Unity and worked as expected…

so the node3d has this code script attached? and below the _process(delta) code has a constant +y global position but the print(global_position.y) is still static?

the camera is a child of this node3d?

The setting is just this:

Main scene with childs (Camera3D and Objecto, the main scene has the script attached:

extends Node3D

func _physics_process(delta):

Objeto is a Node3D scene with child RigidBody3D/MeshInstance and CollisionShape

It’s the RigidBody3D the node that’s moving, the parent Node3D is not moving. transform gets propagated from parent to children not the other way around.

1 Like

Thanks for your answer, not sure if i understood… that means that in the object scene the main node remains static ant it is just the rigidbody who’s falling down? I think i already tried to replace the node3d parent with the rigidbody itself and had the same result… but i’ll double check.

It’s going to depend on where the script is. You are printing the location of the object that has the script. If the script is attached to the parent of the RigidBody3D, and that parent is just a Node3D, then its location will never change.

If you want to see the location of the RigidBody3D, then you need to have the script attached to the RigidBody3D.

Your issue doesn’t seem to have anything to do with local vs global coordinates.

That was exactly what I did not understand, I thought that any node in Godot could also do as an empty container as it is in Unity with Gameobjects, but I see now it is not exactly the same. Now is clear. Thank you all for your time and support.

Any node can be used as a container (whether empty or not), but you have to correctly reference the node from your script. If you don’t specify an object in your reference, it defaults to “self”. In your script, you have:


This is the same as:


The reference to “self” means “whatever object this script is attached to.” Since the script in your example was attached to the Node3D, your script meant:

print([the Node3D object].global_position.y)

That means that you are printing the location of the Node3D object that contains your RigidBody3D.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.