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

Add position_changed signal for Node2D and Node3D #4729

Closed
CsloudX opened this issue Jun 23, 2022 · 7 comments
Closed

Add position_changed signal for Node2D and Node3D #4729

CsloudX opened this issue Jun 23, 2022 · 7 comments

Comments

@CsloudX
Copy link

CsloudX commented Jun 23, 2022

Describe the project you are working on

NO-GAME App

Describe the problem or limitation you are having in your project

I want listen some node's position but I don't want add script for this nodes.

Describe the feature / enhancement and how it helps to overcome the problem or limitation

Add position_changed or transform_changed signal for Node2D and Node3D

Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams

/

If this enhancement will not be used often, can it be worked around with a few lines of script?

I must add script for all this nodes. I'm lazy.

Is there a reason why this should be core and not an add-on in the asset library?

No, It's core.

@Calinou Calinou changed the title Add position_changed signal for Node2D and Node3D Add position_changed signal for Node2D and Node3D Jun 23, 2022
@Calinou
Copy link
Member

Calinou commented Jun 23, 2022

I must add script for all this nodes. I'm lazy.

This is not a sufficient reason for a feature to be added to core.

@CsloudX
Copy link
Author

CsloudX commented Jun 23, 2022

I must add script for all this nodes. I'm lazy.

This is not a sufficient reason for a feature to be added to core.

^V^, I think position_changed was used often, IMO, add the signal make GODOT better.

@Mickeon
Copy link

Mickeon commented Jun 23, 2022

Signals are typically decently fast, but I'm honestly concerned about every existing Node2D and Node3D potentially emitting this signal every frame, even if not connected to anything. If a parent Node2D's position changes, the signal would have to propagate down the tree, and every child Node2D would also subsequently emit the signal.

@KoBeWi
Copy link
Member

KoBeWi commented Jun 23, 2022

We have NOTIFICATION_TRANSFORM_CHANGED, which needs to be explicitly enabled with set_notify_transform(). Maaybe the signal could be emitted together with that notification.

It's not very common though, not sure why would you need it as frequently as you claim.

@smix8
Copy link

smix8 commented Jun 23, 2022

Transform changed is already disabled by default because it wreaks havoc on performance if enabled on to many nodes but it costs nearly nothing and is very fast compared to signals. Sending by default a signal for every slightest transform change is the next best thing for crashing the Engine with the MessageQueue.

@Mickeon
Copy link

Mickeon commented Jun 24, 2022

What's the use-case? What's the actual necessity to implement this natively without using a script (which is possible to accomplish currently)?

@YuriSizov
Copy link
Contributor

I want listen some node's position but I don't want add script for this nodes.

As Calinou stated, this is not a valid justification for a proposal. And as mentioned by others, performance ramifications is something that must be investigated before discussing this feature. So closing as not a valid proposal. Please use the Discussions section or our social and community platforms to look for a solution that works for you. Then a proper proposal may be born, if there is a good legitimate need for an improvement.

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

6 participants