tiled-to-godot-export
tiled-to-godot-export copied to clipboard
Added support for one-way collision shapes
Usage
- In Tiled, select a tile collision shape to show the properties in the left panel
- Under the property "Type" (or "Class" in Tiled 1.9) use the value "one-way"
- Export the tileset to Godot.
Other notes: The "one-way" className/type on the collision shape is the same method employed by godot-tiled-importer
Looks good to me, and the compatibility with the Godot Tiled Importer is nice (does that actually apply to anything else?).
I'm not entirely sure, I haven't used it extensively, but enough to remember that particular aspect.
What about adding support for setting the
one_way_margin
while you're at it, or is that property not useful?
You bring up a good point which might affect the above choice. This plugin already uses a property naming scheme to define Godot node values. Eg. godot:z_index
on the tile properties. Perhaps it might be more consistent to adopt the same scheme for the collisions shapes instead of setting className.
So, perhaps we can set the following custom properties per collision shape:
-
godot:one_way
:true
-
godot:one_way_margin
:1.0
Any thoughts on this scheme vs the className?
@sixthgear Hmm, indeed setting these based only on a properties rather than the Class does seem more suitable.
Please commit (I think?) this seems really useful.
Please commit (I think?) this seems really useful.
It's already committed. There was a short discussion about this change, resulting in an open task (moving this to be based on the listed properties (boolean "godot:one-way" and number "godot:one_way_margin") rather than on the class name ("one-way"). This was suggested by @sixthgear and I agreed, but it seems they never got around to actually making that change.