-
Notifications
You must be signed in to change notification settings - Fork 1.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
Gizmo doesn't follow what it is attached to #6990
Comments
This behavior is intended. The gizmo transform is calculated and then applied to each node attached to the gizmo updating its own position last. The nodes attached to the gizmo were not intended to be programmatically moved |
But the translation gizmo should move along with the entity when it's translated, as the gizmo is attached to the entity and is designed to move in tandem with it. Why is the method even called |
Okay I will change the name then because to allow for the gizmo to move along with the entity requires an update loop to check for all the attached node positions which seems messy |
maybe consider add a boolean to control this, default to false? |
We had this issue, but its solved as part of the application which is the correct place to do imo as it requires application specific knowledge |
If it were possible I would give priority to the gizmo to ensure that user intend is reflected. For example a cube is moved up and down via But as @MAG-AdrianMeredith points out, it's application specific and it would be easy enough to simply disable the cube-up-and-down-script via gizmo events so the gizmo is in charge during user-gizmo-interaction-time. I wouldn't try to mess too much with the script execution order here. What's created first is handled first (aka whatever appended methods via I never needed gizmos so far for controlling animated entities (at best a static target entity for dynamic IK). I only have them on static entities that I want to move around through a gizmo, but every once in a while I also need to reposition those entities programmatically after something "important" happens (e.g. a promise finished and a new/better position is available). |
Testable in: https://playcanvas.vercel.app/#/gizmos/transform-translate
If you move the box afterwards, it suddenly isn't attached any longer:
Result:
The only way around this seems to be to call:
But this is an internal function and even if it were public, it would still be strange to "reinforce" an attachment - as attaching something implies a strong link between things.
The text was updated successfully, but these errors were encountered: