关于Unity3D脚本的问题,NullReferenceException: Object reference not set to an instance of an object
if(Input.GetButtonDown("Fire1")){varn:Transform=Instantiate(newobject,this.Transform....
if(Input.GetButtonDown("Fire1")){
var n: Transform= Instantiate(newobject,this.Transform.Position,this.Transform.Rotation);
var fwd: Vector3=transform.TransformDirection(Vector3.forward);
n.rigidbody.AddForce(fwd*2800);
}
调用实例化的代码如上,求大神指点 展开
var n: Transform= Instantiate(newobject,this.Transform.Position,this.Transform.Rotation);
var fwd: Vector3=transform.TransformDirection(Vector3.forward);
n.rigidbody.AddForce(fwd*2800);
}
调用实例化的代码如上,求大神指点 展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询