找回密码
 立即注册
楼主: 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之后出现一个发射的物体--椰子。   

}
 楼主| 发表于 2015-5-4 19:07 | 显示全部楼层
C:\Users\航\Desktop
发表于 2015-7-1 08:40 | 显示全部楼层
文件路劲貌似不能有中文的
发表于 2017-4-14 09:59 | 显示全部楼层
很不错
发表于 2017-4-14 10:37 | 显示全部楼层
楼主是超人
发表于 2017-4-14 10:40 | 显示全部楼层
真心顶
发表于 2017-4-14 10:02 | 显示全部楼层
很好哦
发表于 2017-4-14 10:18 | 显示全部楼层
LZ真是人才
发表于 2017-5-4 17:56 | 显示全部楼层
很不错
发表于 2017-5-4 17:59 | 显示全部楼层
楼主是超人
懒得打字嘛,点击右侧快捷回复 【右侧内容,后台自定义】
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

小黑屋|手机版|Unity开发者联盟 ( 粤ICP备20003399号 )

GMT+8, 2024-11-23 17:44 , Processed in 0.109645 second(s), 26 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表