投掷团结后产卵

时间:2016-11-10 14:35:01

标签: c# unity3d

我希望我的对象在1秒后重新生成,当我将该对象抛向空中时。我尝试了下面的代码,但无法找出解决方案。如果有人请帮我解决这个问题!

public Transform[] SpawnPoints;
public GameObject ball;
public GameObject lastBall;

void Update(){
    {
        int SpawnIndex = Random.Range (0, SpawnPoints.Length);
        lastBall = Instantiate (ball, SpawnPoints [SpawnIndex].position, SpawnPoints [SpawnIndex].rotation) as GameObject;
    }
}

0 个答案:

没有答案