Files
wrplat-godot/src/components/ResetPlayer.cs
T
2026-06-11 14:43:13 +10:00

22 lines
506 B
C#

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;
}
}
}