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 a method in SharedTransformSystem for swapping the position of two entities #4988

Merged

Conversation

EmoGarbage404
Copy link
Member

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.

Copy link
Contributor

@metalgearsloth metalgearsloth left a 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.

Copy link
Contributor

@metalgearsloth metalgearsloth left a 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.

@metalgearsloth metalgearsloth merged commit 4504731 into space-wizards:master Apr 29, 2024
1 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants