qiuhang222 发表于 2015-5-4 19:06

新手求助,感恩大大们!

UnassignedReferenceException: The variable coconut_bl of 'controlfs' has not been assigned.
You probably need to assign the coconut_bl variable of the controlfs script in the inspector.
UnityEngine.Object.Internal_InstantiateSingle (UnityEngine.Object data, Vector3 pos, Quaternion rot) (at C:/BuildAgent/work/cac08d8a5e25d4cb/Runtime/ExportGenerated/Editor/UnityEngineObject.cs:72)
UnityEngine.Object.Instantiate (UnityEngine.Object original, Vector3 position, Quaternion rotation) (at C:/BuildAgent/work/cac08d8a5e25d4cb/Runtime/ExportGenerated/Editor/UnityEngineObject.cs:82)
kzfsscript.Update () (at Assets/scrits/controlfs.js:8)
这个是报错提示,表米安看起来是我的controlfs脚本的变量coconut_bl 没有被赋值,但是我赋值了!
以下是代码:
var throwsound:AudioClip;
var coconut_bl:Rigidbody;
function Update(){
if(Input.GetButtonDown("Fire1")){
          audio.PlayOneShot(throwsound);
          var newcoconut:Rigidbody;
          newcoconut = Instantiate(coconut_bl,transform.position,transform.rotation);
          newcoconut.velocity = transform.forward*30.0;
          }//定义鼠标,click之后出现一个发射的物体--椰子。   

}

qiuhang222 发表于 2015-5-4 19:07

C:\Users\航\Desktop

StrayCat 发表于 2015-7-1 08:40

文件路劲貌似不能有中文的

蓝杰稀饭 发表于 2017-4-14 09:59

很不错

He4L 发表于 2017-4-14 10:37

楼主是超人

yuanxy92 发表于 2017-4-14 10:40

真心顶

肥马时代 发表于 2017-4-14 10:02

很好哦

bogdanmuri 发表于 2017-4-14 10:18

LZ真是人才

jinmax 发表于 2017-5-4 17:56

很不错

joyhollo 发表于 2017-5-4 17:59

楼主是超人
页: [1]
查看完整版本: 新手求助,感恩大大们!