
2-5 수업을 진행 했을 땐 문제 없이 모든 게 잘 실행 되었습니다.
오늘 2-6 수업을 듣고 실행해보니 아래처럼 풍선에 square가 닿아도 게임오버 되지 않습니다..

그래서 로그를 출력해보았습니다..
square가 생성될 때 = '내린다!'
square가 풍선에 닿았을 때 = '충돌!'

square가 생성될 때 '내린다!' 라는 문구는 나오지만 square가 풍선에 닿았을 때 '충돌!' 이라는 문구는 로그에 기록되지 않네요..

balloon - Circle Collider 2D 세팅

shield - circle Collider 2D 세팅

Prefabs/square Rigidbody 2D, Box Collider 2D 세팅

gameManager Inspector 세팅

gameManager.cs 소스코드
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using UnityEngine.SceneManagement;
public class gameManager : MonoBehaviour
{
public GameObject square;
public GameObject endPanel;
public Text timeTxt;
public Text thisScoreTxt;
public Text maxScoreTxt;
float alive = 0f;
bool isRunning = true;
public static gameManager I;
void Awake()
{
I = this;
}
// Start is called before the first frame update
void Start()
{
Time.timeScale = 1.0f;
InvokeRepeating("makeSquare", 0.0f, 0.5f);
}
// Update is called once per frame
void Update()
{
if (isRunning)
{
alive += Time.deltaTime;
timeTxt.text = alive.ToString("N2");
}
}
void makeSquare()
{
Instantiate(square);
}
public void gameOver()
{
isRunning = false;
Time.timeScale = 0.0f;
thisScoreTxt.text = alive.ToString("N2");
endPanel.SetActive(true);
if (PlayerPrefs.HasKey("bestScore") == false)
{
PlayerPrefs.SetFloat("bestScore", alive);
}
else
{
if (PlayerPrefs.GetFloat("bestScore") < alive)
{
PlayerPrefs.SetFloat("bestScore", alive);
}
}
float maxScore = PlayerPrefs.GetFloat("bestscore");
maxScoreTxt.text = maxScore.ToString("N2");
}
public void retry()
{
SceneManager.LoadScene("MainScene");
}
}
혹시 Script/gameManager의 Inspector 세팅이 None인게 문제인가요?

오류 메세지도 안 뜨고 뭐가 문제인지 모르겠습니다..
