# Unity bug 檢修指南 / Hint 小技巧 [toc] --- ### Bug #### 1. MissingReferenceException: ##### The object of type '' has been destroyed but you are still trying to access it. ```c# private void OnDisable() { EventHandler.GameWin += OnGameWin; // ^ // 應該是'-' } ``` ##### while executing 'performed' callbacks of [...] 注意Unity中其他的BUG,這是假Bug。 #### 2.ArgumentNullException ##### Value cannot be null. Parameter name: _unity_self 在Play按下時,不要選擇任何物件。 #### 3. Rigidbody3D的 velocity 一直為0 在 Project Setting > Physics > GameObject SDK 中 確認是不是PhysX,「**而不是 None**」 請改成PhysX ![截圖 2025-02-13 20.59.40](https://hackmd.io/_uploads/rkRThviYyl.png) #### O. Build Bug ##### Building Library/Bee/artifacts/Android/AsyncPluginsFromLinker failed with output: System.IO.IOException: Read-only file system 換個存檔路徑 --- ### Unity Hint #### 1. OnTriggerStay 間斷不工作問題 修改OnTriggerStay2D的休眠時間方法: 點選Edit -> Project Settings, 然後選擇Physics 2D, 在General Settings中將Time To Sleep修改為較大的數值, 例如10000 ![截圖 2024-01-24 21.24.42](https://hackmd.io/_uploads/Hy41gqAFT.png) #### 2. 在手機上多指點擊按鈕會有斷觸/不觸發的情況 項目中若是使用New Input System 的話,在 UI 的 EventSystem 中的 Input System Ul Input Module 的 Pointer Behavior 變數改為 ***All Pointers As Is*** > 預設可能是 ***Single Mouse Or Pen But Multi Touch And Track*** ![截圖 2025-03-24 21.52.48](https://hackmd.io/_uploads/B1xTX1k6yx.png)