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

Added support for one-way collision shapes #51

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

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