From 635a832ec873d545d40c949de2576e3de2b98ee3 Mon Sep 17 00:00:00 2001 From: Rendo Date: Mon, 28 Jul 2025 05:28:39 +0500 Subject: [PATCH] fixed hitbox and timescale working on toggle --- scenes/entities/plants/snipach.tscn | 4 ++-- scripts/entities/plants/DragAction.cs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/scenes/entities/plants/snipach.tscn b/scenes/entities/plants/snipach.tscn index cc6a782..1156733 100644 --- a/scenes/entities/plants/snipach.tscn +++ b/scenes/entities/plants/snipach.tscn @@ -21,7 +21,7 @@ atlas = ExtResource("3_ktw4a") region = Rect2(525, 241, 79, 72) [sub_resource type="RectangleShape2D" id="RectangleShape2D_ktw4a"] -size = Vector2(39.5, 66) +size = Vector2(39.5, 45) [sub_resource type="AtlasTexture" id="AtlasTexture_3hyni"] atlas = ExtResource("3_ktw4a") @@ -40,7 +40,7 @@ position = Vector2(8, -16) texture = SubResource("AtlasTexture_f4wwx") [node name="CollisionShape2D" type="CollisionShape2D" parent="Hitbox" index="0"] -position = Vector2(-0.75, -13) +position = Vector2(-0.75, -2.5) shape = SubResource("RectangleShape2D_ktw4a") [node name="DragAction" type="Node" parent="Hitbox" index="1"] diff --git a/scripts/entities/plants/DragAction.cs b/scripts/entities/plants/DragAction.cs index e39717c..b0fc02f 100644 --- a/scripts/entities/plants/DragAction.cs +++ b/scripts/entities/plants/DragAction.cs @@ -32,7 +32,7 @@ public partial class DragAction : Node toggle = false; can_end = false; EmitSignal(SignalName.DragBegin); - GetTree().CreateTimer(0.2).Timeout += OnToggleTimeout; + GetTree().CreateTimer(0.2,ignoreTimeScale:true).Timeout += OnToggleTimeout; } if (dragging && can_end && (toggle == false && @event.IsActionReleased("primary_action") || (toggle == true && @event.IsActionPressed("primary_action")))) {