🐛 Bug fixes
This commit is contained in:
		| @@ -75,8 +75,8 @@ public partial class TurretTile : BaseTile | ||||
|             _hasTarget = true; | ||||
|              | ||||
|             // Calculate target angle | ||||
|             var direction = (nearestEnemy.GlobalPosition - _spriteBarrel.GlobalPosition).Normalized(); | ||||
|             var targetAngle = Mathf.Atan2(direction.Y, direction.X); | ||||
|             var direction = (nearestEnemy.GlobalPosition - _barrelTip.GlobalPosition).Normalized(); | ||||
|             var targetAngle = direction.Angle() + 90f; | ||||
|  | ||||
|             // Smoothly rotate towards target | ||||
|             _spriteBarrel.Rotation = Mathf.LerpAngle(_spriteBarrel.Rotation, targetAngle, (float)delta * RotationSpeed); | ||||
|   | ||||
		Reference in New Issue
	
	Block a user