ddanakim0304 / First-Game-Dev-Project-Unity3d

(Unity & C#) My first ever game dev project!
0 stars 0 forks source link

Bug #1

Closed ddanakim0304 closed 1 month ago

ddanakim0304 commented 1 month ago

Playing level 4 automatically triggers the level complete function.

ddanakim0304 commented 1 month ago

Fixed:

Added a condition to complete the level only when the player enters the trigger. The OnTriggerEnter function was detecting all the collision including ground tiles without the if statement.

Before void OnTriggerEnter (Collider other) { gameManager.CompleteLevel(); }

After void OnTriggerEnter (Collider other) { if (other.tag == "Player") { gameManager.CompleteLevel(); } }