-
Notifications
You must be signed in to change notification settings - Fork 82
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
LDTK region strange in runtime #267
Comments
I see - thanks for elaborating on that. It's a very strange issue. Out of curiosity - does the collider shape change at all if you switch them? Like registering the |
Could you use |
I think I have an idea of what might be happening. It looks like you might be using a |
#271 should fix this. I'd ask you to try it but there have been a lot of breaking changes since 0.8 that could be annoying to deal with |
…size as basis when calculating ldtk entity scale (#271) Closes #267 LDtk populates an `EntityInstance`'s `__tile` field if any tile is used when visualizing that entity in-level. This is normally just the entity's editor visual, but if that entity is given a singular tile field instance and has no editor visual, it might use that instead. Currently, `bevy_ecs_ldtk` uses this field to calculate the scale when spawning `EntityInstance`s. This can lead to unexpected behavior. The scale of entity instances with no entity visual should correlate to the size of the instance in the level. This might not be the case for entities that have a tile field despite having no editor visual. The solution implemented here is to use the `tileRect` field of the entity definition instead of the `__tile` field of the entity instance. To be honest, I'm not totally satisfied with this solution either. The entity spawning process is currently designed to match the visuals in the editor when using sprites. However, it's not perfect at doing this, and using the transform's scale to accomplish this makes the logic affect a lot more components than just the sprite. It also affects colliders, for example. However, for now, this should be a satisfactory fix that does not affect many users negatively
I have testd these collider
The first region work great after i set Collider::cuboid(8. , 8.), 16*16 in ldtk editor.
But the second region size strange again.
It seems ldtk entity will change Collider i created.
So i don't know what is right way to set a collider sensor for region which i want to active some game event. What should i do?
The text was updated successfully, but these errors were encountered: