0

I want my object to respawn after 1 second when I throw that object to air.I tried below code but cant figure out the solution.If someone please help me solving this problem!

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;
    }
}
alter ego
  • 69
  • 7
  • Is this a duplicate of your previous question? https://stackoverflow.com/questions/40403377/spawn-after-throw –  Nov 10 '16 at 14:37
  • Yes,because I couldnt sort out. – alter ego Nov 10 '16 at 14:39
  • Looking at this and your previous question I believe even getting the answer to this one problem won't get your that much further. If you want to learn some programming in general and / or with unity, you should look at their tutorials: https://unity3d.com/de/learn/tutorials – user3488765 Nov 10 '16 at 14:45

0 Answers0