Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename "translation" to "position" in Spatial? #9128

Closed
novemberist opened this issue Jun 12, 2017 · 6 comments
Closed

Rename "translation" to "position" in Spatial? #9128

novemberist opened this issue Jun 12, 2017 · 6 comments

Comments

@novemberist
Copy link

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.

@nunodonato
Copy link
Contributor

nunodonato commented Jun 12, 2017

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

@novemberist
Copy link
Author

novemberist commented Jun 12, 2017

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.

@eon-s
Copy link
Contributor

eon-s commented Jun 12, 2017

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

@vnen
Copy link
Member

vnen commented Jun 12, 2017

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

@Zylann
Copy link
Contributor

Zylann commented Jun 12, 2017

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

@akien-mga akien-mga changed the title get_position() for Position2D/Position3D node Rename "translation" to "position" in Spatial? Jun 29, 2017
@kubecz3k
Copy link
Contributor

kubecz3k commented Apr 4, 2018

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants