diff --git a/Assets/Scripts/Game/Yummies/YummyCake.cs b/Assets/Scripts/Game/Yummies/YummyCake.cs index a02bf14..f3b32cb 100644 --- a/Assets/Scripts/Game/Yummies/YummyCake.cs +++ b/Assets/Scripts/Game/Yummies/YummyCake.cs @@ -22,6 +22,8 @@ public class YummyCake : MonoBehaviour private Animator animator; + private WorldFiller worldFiller; + private static float laserProbability = 0.4f; private static float magnetProbability = 0.2f; @@ -39,12 +41,14 @@ public class YummyCake : MonoBehaviour animator = GetComponent(); audioSource.PlayOneShot(spawnSound); + + worldFiller = GameObject.FindWithTag("WorldFiller")?.GetComponent(); } public void BreakOrMiss() { // TODO: Implement logic to check if the cake is in a clear area or not - bool inClearArea = true; + bool inClearArea = worldFiller.IsPositionInFreeArea(transform.position); if (inClearArea) {