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

Fix levels having incorrect GlobalTransform the first frame #140

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

johanhelsing
Copy link
Contributor

@johanhelsing johanhelsing commented Nov 23, 2022

The transform propagation system runs in the PostUpdate stage, so spawn the levels before PostUpdate so they have time to propagate, but after ProcessApi, so they'll be ready the next frame (assuming the LdtkWorldBundle will be spawned during the Update) stage.

I ran into this bug because in my game I scale the levels, and collision detection is therefore way off during the first frame sending my player character flying.

@Trouv
Copy link
Owner

Trouv commented Nov 26, 2022

I have to give this some thought. I'd prefer not to add another stage if possible, but I can't think of a way to off the top of my head. One reason I wanted to put level spawning before Update was so that users could flesh out entities using the "blueprint pattern" (querying for Added<EntityInstance> or Added<MarkerComponent>) during Update and not have any frame delay. Though, this seems like a reasonable concern too.

@geieredgar geieredgar mentioned this pull request Mar 11, 2023
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants