소스 검색

small hack to make collisionobjects work with replace, fixes #2992

Juan Linietsky 9 년 전
부모
커밋
eab1e5b596
1개의 변경된 파일5개의 추가작업 그리고 0개의 파일을 삭제
  1. 5 0
      tools/editor/scene_tree_dock.cpp

+ 5 - 0
tools/editor/scene_tree_dock.cpp

@@ -1268,6 +1268,11 @@ void SceneTreeDock::_create() {
 			editor->set_edited_scene(newnode);
 			editor->set_edited_scene(newnode);
 		}
 		}
 
 
+		//small hack to make collisionshapes and other kind of nodes to work
+		for(int i=0;i<newnode->get_child_count();i++) {
+			Node *c=newnode->get_child(i);
+			c->call("set_transform", c->call("get_transform") );
+		}
 		editor_data->get_undo_redo().clear_history();
 		editor_data->get_undo_redo().clear_history();
 		newnode->set_name(newname);
 		newnode->set_name(newname);