fixed hitbox and timescale working on toggle

This commit is contained in:
Rendo 2025-07-28 05:28:39 +05:00
commit 635a832ec8
2 changed files with 3 additions and 3 deletions

View file

@ -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"]

View file

@ -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"))))
{