Apply that physics interpolation thing to warping enemies with items
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user