-
Notifications
You must be signed in to change notification settings - Fork 446
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 a method in SharedTransformSystem for swapping the position of two entities #4988
Add a method in SharedTransformSystem for swapping the position of two entities #4988
Conversation
Robust.Shared/GameObjects/Systems/SharedTransformSystem.Component.cs
Outdated
Show resolved
Hide resolved
Robust.Shared/GameObjects/Systems/SharedTransformSystem.Component.cs
Outdated
Show resolved
Hide resolved
Robust.Shared/GameObjects/Systems/SharedTransformSystem.Component.cs
Outdated
Show resolved
Hide resolved
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.
What happens if Entity A is parented to Entity B further up the hierarchy? This also really needs a test.
Robust.Shared/GameObjects/Systems/SharedTransformSystem.Component.cs
Outdated
Show resolved
Hide resolved
Robust.Shared/GameObjects/Systems/SharedTransformSystem.Component.cs
Outdated
Show resolved
Hide resolved
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.
Not sure if you care but the rotations will be based on their old local-rotations.
… into swap-positions-method
Common content pattern that breaks frequently due to oversights (using entity coordinates, not respecting containers, etc)
The method simply takes two entities and swaps their world positions, moving them across maps. This hopefully will reduce issues in content where bad transform calls result in unintended parenting to various entities.