Last Updated on 2021-10-25 by Clay
問題描述
今天我在測試製作的遊戲時,我的 Main Camera 突然看不到任何我放置的遊戲物件。然而若是我開啟另一個新專案,則 Main Camera 又可以正常運作。
根據我查詢到的方法、實測之後終於解決了。其可能發生的問題紀錄如下:
- 物件被隱藏
- 攝影機的 Clipping Planes 數值設定有誤(我的情況屬於這種)
解決方法
狀況一: 物件被隱藏
檢查 Inspector 中物件名稱前是否有勾選;若沒有勾選,則物件不可見。

範例:

狀況二: 攝影機的 Clipping Planes 數值設定有誤
運行遊戲進行測試,調整 Main Camera 的 Clipping Planes 數值,直到遊戲物件可視為止。

References
- https://stackoverflow.com/questions/28469186/game-object-appears-in-scene-view-but-not-in-game-view
- https://answers.unity.com/questions/904874/camera-not-displaying-any-gameobjects-in-scene.html