godot-tiled-importer
godot-tiled-importer copied to clipboard
Point objects: rotation not imported
Plugin version 2.3
Issue description Rotation is not imported for Point objects. It is useful for game logic.
Steps to reproduce
- In Tiled, add object layer.
- Add Point to layer.
- Click on rotation button to change rotation of point
- Import tilemap to Godot
Sample map or tileset TestTrack.zip
code fix Insert at line 361 in tiled_map_reader.gd: if "point" in object and object.point: var point = Position2D.new() if not "x" in object or not "y" in object: print_error("Missing coordinates for point in object layer.") continue point.position = Vector2(float(object.x), float(object.y)) if "rotation" in object: point.rotation_degrees = float(object.rotation) point.visible = bool(object.visible) if "visible" in object else true ...
Hmm, in fact in Tiled, point objects can't be rotated. I guess this is something I've disabled after this issue was opened (though they could not be rotated already when https://github.com/mapeditor/tiled/pull/1799 was merged).
I can see it has its uses though, as demonstrated by the provided example, so maybe it's worth properly supporting at some point.