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();
|
var randomSpawnPoint = spawnPointsGodotCollection.PickRandom();
|
||||||
|
|
||||||
GlobalPosition = new Vector3(randomSpawnPoint.GlobalPosition.X, GlobalPosition.Y, randomSpawnPoint.GlobalPosition.Z);
|
GlobalPosition = new Vector3(randomSpawnPoint.GlobalPosition.X, GlobalPosition.Y, randomSpawnPoint.GlobalPosition.Z);
|
||||||
|
ResetPhysicsInterpolation();
|
||||||
_previousPosition = GlobalPosition;
|
_previousPosition = GlobalPosition;
|
||||||
|
|
||||||
if (this is IHavePatrolBehavior patrolEnemy)
|
if (this is IHavePatrolBehavior patrolEnemy)
|
||||||
|
|||||||
@@ -71,6 +71,7 @@ public partial class Chinthe : Enemy2D, IHaveEngagePlayerBehavior, IHaveFollowBe
|
|||||||
var currentDirection = GlobalBasis.Z.Normalized();
|
var currentDirection = GlobalBasis.Z.Normalized();
|
||||||
var amountToTeleportBy = dot > 0 ? 5 : -5;
|
var amountToTeleportBy = dot > 0 ? 5 : -5;
|
||||||
GlobalPosition = GlobalPosition + new Vector3(amountToTeleportBy * targetPosition.X, 0, amountToTeleportBy * targetPosition.Z);
|
GlobalPosition = GlobalPosition + new Vector3(amountToTeleportBy * targetPosition.X, 0, amountToTeleportBy * targetPosition.Z);
|
||||||
|
ResetPhysicsInterpolation();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void OnChintheVelocityComputed(Vector3 safeVelocity)
|
public void OnChintheVelocityComputed(Vector3 safeVelocity)
|
||||||
|
|||||||
Reference in New Issue
Block a user