fix: dragging units can no longer go haywire and yeet units off the map
This commit is contained in:
@@ -113,6 +113,9 @@ public class UnitCombat : UnitComponent {
|
||||
continue;
|
||||
}
|
||||
|
||||
// Prevent units from entering a runaway situation where they constantly pull each other at high speeds across the map
|
||||
speedDelta = Mathf.Min(speedDelta, draggedUnitMovement.data.moveSpeed.Value);
|
||||
|
||||
draggedUnitMovement.SetNewRotation(-transform.position.DirectionTo(draggedUnit.transform.position), 1f, true);
|
||||
draggedUnitMovement.SetNewDirection(positionDelta.ToVector2(), 1f, true);
|
||||
draggedUnitMovement.SetNewSpeed(speedDelta, 1f, true);
|
||||
|
||||
Reference in New Issue
Block a user