From: KG0104 <76601263+KG0104@users.noreply.github.com> Date: Sun, 26 Sep 2021 10:21:39 +0000 (+0200) Subject: Snail can no longer be attacked before the actual fight starts X-Git-Url: https://git.lizzy.rs/?a=commitdiff_plain;h=3d687ef63c04a8b7e1cb39d569ba98f4aa684d6e;p=SuperMouseAdventure.git Snail can no longer be attacked before the actual fight starts --- 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() {