2
我正在關注Unity3d上的「MoveAround」UnityScript教程。問題是導師寫的代碼時,他拖放腳本到對象,然而,當我這樣做,我得到這些錯誤信息工作正常:Unity UnityScript錯誤
Unknown identifier:
line 14 'Speed' (BCE0005) and
line 15'Curspeed'
的代碼是完全一樣的教程顯示:
1
2 var speed = 3.0;
3 var rotateSpeed = 3.0;
4
5 function Update()
6 {
7 var controller : CharacterController = GetComponent(CharacterController);
8
9 // Rotate around y - axis
10 transform.Rotate(0, Input.GetAxis ("Horizontal")* rotateSpeed, 0);
11
12 // Move forward/backward
13 var forward = transform.TransformDirection(Vector3.forward);
14 var CurSpeed = Speed * Input.GetAxis ("Vertical"); Unknown identifier:'Speed' BCE0005
15 controller.SimpleMove(forward * curspeed); Unknown identifier:'Curspeed' BCE0005
16 }
17
18 @script RequireComponent(CharacterController)