wip - fixing movement physics
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user