unity3d Instantiate随机范围位置的问题Instantiate(mObjects[0],new Vector3(Random.Range(this.transform.position.x-25,this.transform.position.x+25),1F,-2F),Quaternion.Euler(new Vector3(90F,180F,0F)));,要想同时在z方向也一样的效果,
来源:学生作业帮助网 编辑:六六作业网 时间:2024/11/26 09:02:56
unity3d Instantiate随机范围位置的问题Instantiate(mObjects[0],new Vector3(Random.Range(this.transform.position.x-25,this.transform.position.x+25),1F,-2F),Quaternion.Euler(new Vector3(90F,180F,0F)));,要想同时在z方向也一样的效果,
unity3d Instantiate随机范围位置的问题
Instantiate(mObjects[0],new Vector3(Random.Range(this.transform.position.x-25,this.transform.position.x+25),1F,-2F),
Quaternion.Euler(new Vector3(90F,180F,0F)));
,要想同时在z方向也一样的效果,改怎么写呢,后面的1f,
unity3d Instantiate随机范围位置的问题Instantiate(mObjects[0],new Vector3(Random.Range(this.transform.position.x-25,this.transform.position.x+25),1F,-2F),Quaternion.Euler(new Vector3(90F,180F,0F)));,要想同时在z方向也一样的效果,
vector3(x,y,z)
Random.Range(float min,float max);在min和max之间随机一个float数,也可以是int
1f,2f,是y和z
欧拉角?旋转角度?