Rework attack to properly use swingRange and swingDistance
This commit is contained in:
@@ -114,6 +114,7 @@ MonoBehaviour:
|
|||||||
dashCooldownSeconds: 5
|
dashCooldownSeconds: 5
|
||||||
lastAttackTime: 0
|
lastAttackTime: 0
|
||||||
lastDashTime: 0
|
lastDashTime: 0
|
||||||
|
distanceIndicator: {fileID: 0}
|
||||||
--- !u!50 &-4152331571693237436
|
--- !u!50 &-4152331571693237436
|
||||||
Rigidbody2D:
|
Rigidbody2D:
|
||||||
serializedVersion: 5
|
serializedVersion: 5
|
||||||
|
|||||||
@@ -51,9 +51,10 @@ public class Teo : MonoBehaviour
|
|||||||
transform.position,
|
transform.position,
|
||||||
swingRange,
|
swingRange,
|
||||||
new Vector2(
|
new Vector2(
|
||||||
Screen.width/2 - Input.mousePosition.x,
|
Input.mousePosition.x - Screen.width/2,
|
||||||
Screen.height/2 - Input.mousePosition.y
|
Input.mousePosition.y - Screen.height/2
|
||||||
)
|
).normalized,
|
||||||
|
swingDistance
|
||||||
);
|
);
|
||||||
// Damage all ratbots in scanned area
|
// Damage all ratbots in scanned area
|
||||||
foreach (RaycastHit2D hit in hits) {
|
foreach (RaycastHit2D hit in hits) {
|
||||||
|
|||||||
Reference in New Issue
Block a user