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?
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.
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:
print(global_position.y)
This is the same as:
print(self.global_position.y)
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.