From 3d687ef63c04a8b7e1cb39d569ba98f4aa684d6e Mon Sep 17 00:00:00 2001 From: KG0104 <76601263+KG0104@users.noreply.github.com> Date: Sun, 26 Sep 2021 12:21:39 +0200 Subject: [PATCH] Snail can no longer be attacked before the actual fight starts --- 2DGame/Assets/Scripts/Dialogue/BossDialogue.cs | 1 + 2DGame/Assets/Scripts/Enemies/Boss/Boss.cs | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/2DGame/Assets/Scripts/Dialogue/BossDialogue.cs b/2DGame/Assets/Scripts/Dialogue/BossDialogue.cs index 7968672..b4042e6 100644 --- a/2DGame/Assets/Scripts/Dialogue/BossDialogue.cs +++ b/2DGame/Assets/Scripts/Dialogue/BossDialogue.cs @@ -73,6 +73,7 @@ public class BossDialogue : MonoBehaviour dialogueBox.SetActive(false); SpeechBubble.SetActive(false); boss.bossfight = true; + bossObject.GetComponent().constraints = RigidbodyConstraints2D.FreezeRotation; mouse.GetComponent().constraints = RigidbodyConstraints2D.FreezeRotation; mouse.GetComponent().enabled = true; FindObjectOfType().Play("snail_fight"); diff --git a/2DGame/Assets/Scripts/Enemies/Boss/Boss.cs b/2DGame/Assets/Scripts/Enemies/Boss/Boss.cs index 68975e2..d31b28a 100644 --- a/2DGame/Assets/Scripts/Enemies/Boss/Boss.cs +++ b/2DGame/Assets/Scripts/Enemies/Boss/Boss.cs @@ -22,6 +22,11 @@ public class Boss : MonoBehaviour public Sprite fullHeart; public Sprite emptyHeart; + private void Start() + { + GetComponent().constraints = RigidbodyConstraints2D.FreezeAll; + } + // Update is called once per frame void Update() { -- 2.44.0