Unity在地图范围内任意位置随机生成3D模型

using System.Collections;
using System.Collections.Generic;
using UnityEngine;


public class GameController : MonoBehaviour {
    public GameObject tank;
    float timer = 0;
// Use this for initialization
void Start () {

}

// Update is called once per frame
void Update () {
        timer += Time.deltaTime;
        if (timer >= 5)
        {
            timer = 0;
            Instantiate(model, new Vector3(Random.Range(-11f, 60f),95,Random.Range(-10f,65f)),Quaternion.identity);
        }
}
}

你可能感兴趣的:(Unity在地图范围内任意位置随机生成3D模型)