From 8529763a0f9b4368bc907c61c47e1eaeacc374e4 Mon Sep 17 00:00:00 2001 From: Swarnim Arun Date: Mon, 30 Apr 2018 22:59:34 +0530 Subject: [PATCH] Fix tileset bug #18090 to use StaticBody2D position Using staticbody2d position to affect the collision shape position whenever a tileset is created. Formatting the code Removed the most get/set from my old code. --- editor/plugins/tile_set_editor_plugin.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/editor/plugins/tile_set_editor_plugin.cpp b/editor/plugins/tile_set_editor_plugin.cpp index 41692e805f9..b3229b6cf30 100644 --- a/editor/plugins/tile_set_editor_plugin.cpp +++ b/editor/plugins/tile_set_editor_plugin.cpp @@ -126,7 +126,7 @@ void TileSetEditor::_import_node(Node *p_node, Ref p_library) { Transform2D shape_transform = sb->shape_owner_get_transform(E->get()); bool one_way = sb->is_shape_owner_one_way_collision_enabled(E->get()); - shape_transform.set_origin(shape_transform.get_origin() - phys_offset); + shape_transform[2] -= phys_offset - sb->get_transform().xform(shape_transform[2]); for (int k = 0; k < sb->shape_owner_get_shape_count(E->get()); k++) {