Godot: Rename "translation" to "position" in Spatial?

Created on 12 Jun 2017  路  6Comments  路  Source: godotengine/godot

Godot 3.0

As I understand it, the Position2D and Position3D node is supposed to be a simple helper node to exchange positional information (e.g. in a tree where no other node has a get_position() method). However, unfortunately this class has no get_position() method of its own. I would find it very usefull to add a get_position() and set_position() method to it, so it could e.g. be used as a node for a camera (which is child to Position node) that follows a player controller (with a Position node as a child) and other stuff.

archived discussion core

Most helpful comment

I thought having "translation" for 3D nodes instead of "position" was weird in the first place.

All 6 comments

Consider Position nodes like "empties" in 3d space.
They inherit from the spatial class, so the methods are the same. You can get their translation (relative to parent) or, if you need the position in global space, you can get it via get_global_transform().origin

tested this before i opened this feature request and get_translation() on a Position3D node in a tree gives me its global translation and not the translation relative to parent. that's why I thought get_position() would be a nice thing to add to this specific node type (making its potential use cases a little clearer and to distinguish it a bit from a simple "Spatial" node). But sure, there's of course various ways to achieve the same thing without it.

[edit]
nevermind, i was being stupid. of course get_translation() works as expected. i was just mixing things up here in my testing setup. still, for convenience get_position()/set_position() would be nice to have IMO with this node type. But not strictly necessary, of course.

@novemberist on Godot 3, 2D nodes have the position property (and 3D translation).

I think it's best to leave as translation for Position3D, so it stays consistent. Doing MySpatialNode.translation = MyPosition3D.position seems weird to me.

I thought having "translation" for 3D nodes instead of "position" was weird in the first place.

Godot 3.0 is out for some time and I don't think we will have such huge api breakage change only for cosmetic reasons at current moment. So I'm closing.

Was this page helpful?
0 / 5 - 0 ratings