Apply that physics interpolation thing to warping enemies with items

This commit is contained in:
2026-03-01 18:06:48 -08:00
parent 840ffe1a9a
commit 46f0e78405
2 changed files with 2 additions and 0 deletions

View File

@@ -216,6 +216,7 @@ public abstract partial class Enemy : CharacterBody3D, IEnemy, IProvide<IEnemyLo
var randomSpawnPoint = spawnPointsGodotCollection.PickRandom();
GlobalPosition = new Vector3(randomSpawnPoint.GlobalPosition.X, GlobalPosition.Y, randomSpawnPoint.GlobalPosition.Z);
ResetPhysicsInterpolation();
_previousPosition = GlobalPosition;
if (this is IHavePatrolBehavior patrolEnemy)

View File

@@ -71,6 +71,7 @@ public partial class Chinthe : Enemy2D, IHaveEngagePlayerBehavior, IHaveFollowBe
var currentDirection = GlobalBasis.Z.Normalized();
var amountToTeleportBy = dot > 0 ? 5 : -5;
GlobalPosition = GlobalPosition + new Vector3(amountToTeleportBy * targetPosition.X, 0, amountToTeleportBy * targetPosition.Z);
ResetPhysicsInterpolation();
}
public void OnChintheVelocityComputed(Vector3 safeVelocity)