godot-tiled-importer icon indicating copy to clipboard operation
godot-tiled-importer copied to clipboard

Point objects: rotation not imported

Open mrgkingcs opened this issue 5 years ago • 1 comments

Plugin version 2.3

Issue description Rotation is not imported for Point objects. It is useful for game logic.

Steps to reproduce

  1. In Tiled, add object layer.
  2. Add Point to layer.
  3. Click on rotation button to change rotation of point
  4. 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 ...

mrgkingcs avatar Aug 10 '20 11:08 mrgkingcs

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.

bjorn avatar May 17 '22 15:05 bjorn