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

New Class property (vs older Type property) : Area generates StaticBody2D instead of Area2d #166

Open
yarrayunder opened this issue Oct 20, 2022 · 0 comments

Comments

@yarrayunder
Copy link

Tiled version 1.9.2
Plugin version 2.3 (same with 2.4)
Godot version 3.4.5

**Issue description :
After Tiled 1.9x, Godot creates "StaticBody2D" objects instead of "Area2d" objects like previously.
In Tiled 1.9.2, uppon re-opening previously created maps, object layers that had objects with "type" = "area" are converted to "class"="Area". The "Type" property is lost.

Tiled importer plugin now creates StaticBody2D.new() instead of Area2D.new() because it relies on the "type" property instead of the new "class" property. (var body = Area2D.new() if object.type == "area" else StaticBody2D.new())

Steps to reproduce

In Tiled 1.9x, create object layer with rectangle shape with class property = "area". Import in godot : Godot will crete a "StaticBody2D" instead of "Area2d".

**Temporary fix

I modified "tiled_map_reader.gd", and changed this line :

var body = Area2D.new() if object.type == "area" else StaticBody2D.new()

for this :

var body = Area2D.new() if object.type == "area" or object.class == "area" else StaticBody2D.new()

Thanks !

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

No branches or pull requests

1 participant