From cb36c7d9c0267836d14f4ca011ad6516ec29e113 Mon Sep 17 00:00:00 2001 From: Iazubi Date: Sat, 26 Oct 2024 01:23:56 -0700 Subject: [PATCH] Increased Attack base range to 2 for testing and commented out ratbot null thing --- Assets/Scenes/SampleScene.unity | 2 +- Assets/Scripts C#/Teo.cs | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/Assets/Scenes/SampleScene.unity b/Assets/Scenes/SampleScene.unity index 44e0a04..8c0462d 100644 --- a/Assets/Scenes/SampleScene.unity +++ b/Assets/Scenes/SampleScene.unity @@ -325,7 +325,7 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 6118034672792182209, guid: e05928a0d673caf999d31b31b994a112, type: 3} propertyPath: swingDistance - value: 1 + value: 2 objectReference: {fileID: 0} - target: {fileID: 6118034672792182209, guid: e05928a0d673caf999d31b31b994a112, type: 3} propertyPath: distanceIndicator diff --git a/Assets/Scripts C#/Teo.cs b/Assets/Scripts C#/Teo.cs index 2abcc9c..f38a09a 100644 --- a/Assets/Scripts C#/Teo.cs +++ b/Assets/Scripts C#/Teo.cs @@ -57,14 +57,18 @@ public class Teo : MonoBehaviour Ratbot ratbot = hit.GetComponent(); // If ratbot exists and is within swing range, damage it. // Calculate absolute difference between angles of ratbot and cursor - if (ratbot == null || Mathf.Abs(Mathf.Atan2( + /* if (ratbot == null || Mathf.Abs(Mathf.Atan2( ratbot.transform.position.y - transform.position.y, ratbot.transform.position.x - transform.position.x ) - Mathf.Atan2( Screen.height/2 - Input.mousePosition.y, Screen.width/2 - Input.mousePosition.x )) > swingRangeDeg * Mathf.Deg2Rad - ) continue; + ) */ + if (ratbot == null) { + continue; + } + ratbot.Damage(damageStrength); } }