🚧 interaction kinda sorta works now, still needs tweaking
This commit is contained in:
@@ -19,7 +19,7 @@ public partial class DetectionCross : Node2D
|
||||
public void SetDirection(Vector2 direction)
|
||||
{
|
||||
Vector2 newPos = new Vector2(direction.X * _xOffset, direction.Y * _yOffset);
|
||||
_collider.GlobalPosition = newPos;
|
||||
_collider.Position = newPos;
|
||||
_detector.TargetPosition = newPos;
|
||||
}
|
||||
}
|
||||
@@ -46,6 +46,7 @@ public partial class InteractionArea2D : Node2D
|
||||
|
||||
public void OnPlayerEntered(Node2D player)
|
||||
{
|
||||
GD.Print("OnPlayerEntered: " + this.GetParent().Name);
|
||||
if (!_active || !InputService.Instance.InputEnabled)
|
||||
return;
|
||||
|
||||
|
||||
@@ -32,6 +32,7 @@ public partial class RaycastDetector : RayCast2D
|
||||
_lastDetected.NoLongerDetected();
|
||||
}
|
||||
|
||||
GD.Print("Colliding with: " + interactionArea.GetParent().Name);
|
||||
_lastDetected = interactionArea;
|
||||
interactionArea.Detected();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user