wip - fixing movement physics

This commit is contained in:
qwsdcvghyu89
2026-06-11 14:43:13 +10:00
parent 77bc341f9b
commit 3ccf193a7c
5 changed files with 66 additions and 18 deletions
+21
View File
@@ -0,0 +1,21 @@
using Godot;
using System;
public partial class ResetPlayer : Area2D {
[Export]
public Node2D Player { get; set; }
[Export]
public Vector2 ResetPosition { get; set; }
public override void _Ready() {
this.BodyShapeEntered += OnBodyShapeEntered;
base._Ready();
}
private void OnBodyShapeEntered(Rid bodyRid, Node2D body, long bodyShapeIndex, long localShapeIndex) {
if (Player == body) {
Player.Position = ResetPosition;
}
}
}