-
-
Notifications
You must be signed in to change notification settings - Fork 21.4k
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
Offset Node3D position when drag and dropping #84438
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested locally, it works as expected.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should the rotation be applied too? I think its currently identity. I’d assume axis aligned drops?
For the record, your commit seems not to be linked to your GitHub account. See: Why are my commits linked to the wrong user? for more info. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See above review, this seems to introduce other issues.
Hmm good catch, apologies I should have tested this more thoroughly. I may have time to follow up on this in a week or so |
@warent Will you be able to work further on this? 🙃 |
Maybe I'm misunderstanding something, but not including the issue with rotation and scaling. Isn't this the expected behavior? Those vectors represent the position of the instantiated scene relative to its parent node. If it's at (-10,0,0) world space, it should show as (-12,0,0) local, right? It's -12 units away from its parent (2,0,0). Also, If I have a fix for the rest of this, do I open a new PR, or a review? I want to make sure @warent is credited for partially fixing this. |
My expectation is that the position of the node I'm adding as a child is a local position relative to its new parent, not a global position. Imagine my child scene is a sidecar positioned 1m to the right of its origin. I parent it to the origin (center of gravity) of my motorbike scene. I expect it to be 1m to the right of the bike, like a sidecar would be, regardless of the world position of the bike scene. Edit: On the other hand when testing back then it's not impossible that I might have confused local and global positions in the inspector... :D |
Superseded by #87126. Thanks for the contribution! |
Fix #84424