유니티 3D에서 처음부터 게임을 만들고 있습니다. 할당되지 않은 'MoveAround'의 변수 bullitPrefab :UnassignedReferenceException : 'MoveAround'의 bullitPrefab 변수가 지정되지 않았습니다. Unity3D
내가 오류를
UnassignedReferenceException을 얻고있다. 인스펙터에서 MoveAround 스크립트의 bullitPrefab 변수를 지정해야 할 것입니다. UnityEngine.Object.Internal_InstantiateSingle (UnityEngine.Object 데이터 Vector3 볼때, 쿼터니언 ROT) (C에서 : /BuildAgent/work/812c4f5049264fad/Runtime/ExportGenerated/Editor/UnityEngineObject.cs 44) UnityEngine.Object.Instantiate (UnityEngine. 자산/MoveAround.js에서 53) MoveAround.Update (() : 오브젝트 원래 Vector3 위치 쿼터니언 회전) (C에서 : /BuildAgent/work/812c4f5049264fad/Runtime/ExportGenerated/Editor/UnityEngineObject.cs 22)
은 다음 코드에
enter code here
var speed = 3.0;
var rotateSpeed = 3.0;
var bullitPrefab:Transform;
function Update()
{
var controller : CharacterController = GetComponent(CharacterController);
//Rotate around y - axis
transform.Rotate(0, Input.GetAxis("Horizontal") * rotateSpeed, 0);
//Move forward/bacward
var forward = transform.TransformDirection(Vector3.forward);
var curSpeed = speed * Input.GetAxis("Vertical");
controller.SimpleMove(forward * curSpeed);
if(Input.GetButtonDown("Jump"))
{
var bullit = Instantiate(bullitPrefab, gameObject.Find("spwanPoint").transform.position, Quaternion.identity);
}
}
RequireC @script 오류를 얻고있다 당신은 Unity3d에서 개체에 스크립트를 첨부, 당신은 개체 탐색기에서 대중 바르를 볼 때 creationComplete 컴퍼넌트 (CharacterController) 여기
튜토리얼 http://www.youtube.com/watch?v=wfpZ7_aFoko&list=PL11F87EB39F84E292
"관리자의 MoveAround 스크립트의 bullitPrefab 변수를 지정해야 할 것입니다." 은 오류 메시지에서 수행해야 할 작업을 알려줍니다 – Shredder2500