Unity3D 教學.CG數位學習網

CG 數位學習網 > Unity 教學



您是否在使用 Unity 開發遊戲時遇到問題?透過 Console 視窗的錯誤訊息或許就可以找出原因。

此外,若遇到正常操作不該發生的問題,試著關閉 Unity 編輯器再重新開啟或許就可以解決喔!

 

Error while importing package: Couldn't decompress package

匯入 Unity 資源包時,若檔案的檔名或路徑含有中文,將出現上述的錯誤訊息。例如 Windows XP 作業系統桌面檔案的路徑是「C:\Documents and Settings\user\桌面」,可將檔案移到 C:\ 或其他的資料夾,再重新匯入即可。不過在較新版本的 Unity 編輯器已經支援中文路徑或檔名了。提配磁碟空間是否不足或資源包檔案有問題也會出現此錯誤訊息。

 

There are 2 audio listeners in the scene. Please ensuer there is always exactly one audio listener in the scene.

場景中應該只有一個 Audio listener 收錄聲音,因為 Main Camera 已經有 Audio listener 元件,加入新攝影機或角色控制器也有 Audio listener 元件,請自行取捨。

 

MissingComponentException: There is no 'AudioSource' attached to the "First Person Controller" game object, but a script is trying to access it.

第一人稱控制器未加上 AudioSource 元件,但是有腳本嘗試進行存取,執行 [ Component > Audio > Audio Source ] 為此控制器加上 Audio Source 元件。

 

MissingComponentException There is no 'Rigidbody' attached to the Player game object, but a script is trying to access it.

遊戲物件缺少 Rigidbody 剛體元件,但是有腳本嘗試進行存取,請為此物件加上 Rigidbody 剛體元件。

 

error CS1502: The best overloaded method match for `UnityEngine.Transform.Translate(float, float, float)' has some invalid arguments.

數值為小數時,後面必須加上「f」。

 

error CS1519: Unexpected symbol `;' in class, struct, or interface member declaration.

宣告變數時未設定變數型態

 

HDR RenderTexture format is not supported on this platform. This camera will render without HDR buffers.

此平台不支援 HDR 高動態範圍的著色紋理格式。

 

Lightmapping cancelled, nothing to bake. Mark the objects you want to lightmap as static.

建立燈光貼圖已經取消,並沒有對任何物件進行烘焙貼圖,請您將要烘焙貼圖的物件設為靜態 ( static ) 後,再執行一次烘焙貼圖的操作。

 

UCE0001: ';' expected. Insert a semicolon at the end.

撰寫 C# 腳本的程式碼結尾需要加上分號。

 

The referenced script on this Behaviour is missing!

遊戲執行時找不到參照的腳本,或許是不小心刪掉了!

 

NullReferenceException: Object reference not set to an instance of an object

未設定參照的物件。

 

Dragwindow can only be called within a window callback

請檢查 GUI.DragWindow 程式碼放的位置是否錯誤。

 

error CS1704: An assembly with the same name `UnityEngine.UI' has already been imported. Consider removing one of the references or sign the assembly

嘗試重新開啟 Unity 應可解決此問題。

 

error CS0246: The type or namespace name `Text' could not be found. Are you missing a using directive or an assembly reference?

using UnityEngine;
using System.Collections;
using UnityEngine.UI; ← 使用新版 UI 工具必須增加這一行程式!

 

安裝 Unity 軟體後無法完成線上授權

檢查系統時間日期是否正確,若系統時間與標準時間的差距太大,可能會出現錯誤訊息而無法安裝。

 

3ds Max couldn't conver the max file to an fbx file

請確認是否已安裝 3ds Max 軟體,並且檢查軟體的授權是否正常(使用試用版過期也會導致此問題)。

 

maya couldn't convert the mb file to an fbx file

請確認是否已安裝 Maya 軟體,並且檢查軟體的授權是否正常(使用試用版過期也會導致此問題)。

 

ImportFBX Warnings:

Can't import normals, because mesh 'default' doesn't have it.

Mesh 'default' has no normals. Recalculating normals.

匯入的模型檔案沒有法線,Unity 會自動重新計算,匯入 MakeHuman 製作的人物模型時會出現此訊息。

 

Could not allocate memory: System out of memory!

系統記憶體已用完而產生的嚴重錯誤,當匯入較大的 unitypackage 資源包時可能會發生此現象,請先嘗試先匯入一部份的資源,或者視情況增加系統記憶體。

 

Adding component failed. Add required component of type 'AudioListener' or 'AudioSource' to the game object first.

為物件加入部份的 Audio 音效元件時,必須先套用 AudioListener 或是 AudioSource 元件,否則會出現此錯誤訊息。

 

Your 64 bit Windows installation is missing an important service pack patch. Please apply http://support.microsoft.com/kb/976038 to ensure stability.

若您是 Microsoft Windows 7 64位元作業系統的使用者,請使用線上更新或到微軟網站下載安裝最新版的 Service Pack 更新程式。

 

The Version of this file is not recognizable. Please verify that you are using the most recent version of Character Studio.

檔案無法辨視,使用舊版 3ds Max 載入新版的 BIP 動作檔,會出現此錯誤訊息,請改用新版本的 3ds Max 軟體。

 

Error building Player: UnityException: Bundle Identifier has not been set up correctly

Please set the Bundle Identifier in the Player Settings. The value must follow the convention 'com.YourCompanyName.YourProductName' and can contain alphanumeric characters and underscore.

Each segment must not start with a numeric character or underscore.

發佈 Android 遊戲時 Bundle Identifier 沒有設定正確。