From 812b82d234fed98847ac1b4cb09af77fb6a8dbe5 Mon Sep 17 00:00:00 2001 From: Nitwel Date: Mon, 6 May 2024 18:34:19 +0200 Subject: [PATCH] fix movable --- app/content/functions/movable.gd | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/content/functions/movable.gd b/app/content/functions/movable.gd index be203c0..262f77f 100644 --- a/app/content/functions/movable.gd +++ b/app/content/functions/movable.gd @@ -86,6 +86,10 @@ func _on_grab_move(event: EventPointer): if lock_rotation: get_parent().global_transform = TransformTools.rotate_around_point(get_parent().global_transform, get_parent().to_global(initial_point), initial_rotation - get_parent().global_rotation) + if restrict_movement: + get_parent().global_position = restrict_movement.call(get_parent().global_position) + on_move.emit(get_parent().global_position, get_parent().global_rotation) + func _on_grab_up(event: EventPointer): if event.initiator == initiator2: initiator2 = null