Skip to content

Conversation

sixthgear
Copy link

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

- 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
Copy link
Member

@bjorn bjorn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, and the compatibility with the Godot Tiled Importer is nice (does that actually apply to anything else?). What about adding support for setting the one_way_margin while you're at it, or is that property not useful?

@sixthgear
Copy link
Author

sixthgear commented Aug 6, 2022

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?

@bjorn
Copy link
Member

bjorn commented Aug 11, 2022

@sixthgear Hmm, indeed setting these based only on a properties rather than the Class does seem more suitable.

@cromerc cromerc mentioned this pull request Apr 4, 2023
@elvisish
Copy link

elvisish commented Apr 4, 2023

Please commit (I think?) this seems really useful.

@bjorn
Copy link
Member

bjorn commented Apr 4, 2023

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.

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.

3 participants