-
-
Notifications
You must be signed in to change notification settings - Fork 21.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
Are AutoTile collision shapes different from other collision shapes? #24300
Comments
Afaik, raycasts have a feature to set what type of bodyes it collides with (rigid, kinematic and/or static). By default TileMaps are of type static, but there's an option on the properties to change it's body type to Kinematic, try to play with these values and tell me if you discoversomething. By the other hand, tileset used to support all kinds of collision shapes. For the sake of simplicity, it now supports Convex polygon shapes, maybe there's an issue betwheen this kind of shapes and Raycast2D, not directly related to TileSet itself. |
@MarianoGnu I've set
I didn't test segment, raycast and line shapes as If it's supposed to work like this, there should be documentation describing these various shapes and why they are different. I also think there's UX issue where all these collision shapes are the same filled color (in debug mode with visible collision shapes) even though they work differently. To me as a beginner to game development, this caused a lot of confusion. |
shapes on tilesets are convex polygons |
Sooo I inspected the reproduction project and the tilesets have different colliders. No idea how, the right one has RectangleShape2D, so it indeed behaves differently, but it's not TileSet-related issue. When you create a new collider using the new rectangle tool That said, you won't run into this bug when you make tilesets with the tileset editor. Also different shapes behaving differently with raycast is another issue (probably one of #39876). |
Godot version: 3.0, 3.1 alpha 3
OS/device including version: Windows 10, MacOS
Issue description & steps to reproduce:
I've tried to ask on reddit without any answer, so I'm not sure whether this is a bug or a feature. Either way, it's something that doesn't seem to be documented anywhere.
I'm working with simple sprite exported as
TileSet
. In a blank scene I'm trying to find collisions between aTileMap
and aRayCast2D
.Autotile and RayCast2D don't collide in this case
From what I've tried collisions seem to behave differently when using
Autotile
. If I don't set anyCollisionShape2D
inTileSet
scene, setTileSet
asAutotile
, set collisions on it via Autotiles menu and try to find collision withRayCast2D
it works only if it intersects walls of the tile. If I moveRayCast2D
fully inside of the tile, it doesn't collide with it at all.Autotile and RayCast2D do collide in this case
If I use the
TileSet
with static bodies and their own collison shapes,RayCast2D
doesn't have problems with collisions even if it's fully inside of the tile.TileMapStatic and RayCast2D do collide properly
I'm using default collision layers and masks on both
TileMap
s and onRayCast2D
, so that shouldn't be the problem. I'm confused, because even when I set collision shapes to be visible in debug menu they are in both cases shown as full rectangles, but they don't seem to behave in the same way. Are collisions on Autotiles somehow special or am I just doing something wrong?Minimal reproduction project: https://github.com/ondrowan/godot-autotile-raycast (requires 3.1 alpha)
The text was updated successfully, but these errors were encountered: