Rework attack to properly use swingRange and swingDistance

This commit is contained in:
2024-10-22 12:47:43 -07:00
parent 374355c291
commit 80e63019ed
2 changed files with 5 additions and 3 deletions

View File

@@ -114,6 +114,7 @@ MonoBehaviour:
dashCooldownSeconds: 5
lastAttackTime: 0
lastDashTime: 0
distanceIndicator: {fileID: 0}
--- !u!50 &-4152331571693237436
Rigidbody2D:
serializedVersion: 5

View File

@@ -51,9 +51,10 @@ public class Teo : MonoBehaviour
transform.position,
swingRange,
new Vector2(
Screen.width/2 - Input.mousePosition.x,
Screen.height/2 - Input.mousePosition.y
)
Input.mousePosition.x - Screen.width/2,
Input.mousePosition.y - Screen.height/2
).normalized,
swingDistance
);
// Damage all ratbots in scanned area
foreach (RaycastHit2D hit in hits) {