+1 vote

I already tried in several ways but I could not in any way
- 2D node
- All objects are in the same node
- I want to change position of one object through another object script, if possible

in Engine by (33 points)
reshown by

What do you mean with an object scene. Do you mean an object inside another scene? What kind of position are you looking for? 2D? 3D? Please be a little more specific. Thanks.

translation is the position property for 3D, I don't know if it's the same for 2D.

yourNode.translation

1 Answer

0 votes
Best answer

With 'in the same node' you, mean children of the same node I guess. To answer your question for 2D Nodes position instead of translation.

In that case you can use something similar to this inside your script:

get_parent().get_node("NameOfNode").position= mynewposition

You can get any variable you need, this way.

hope it works

by (864 points)
selected by

How, Yes, that's right! thank you very much! i am beginner with this engine and i still don't know the right terms os words to explain certainly rs, then thank you again

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.