Advertisement

Spawning

Started by December 10, 2017 12:42 AM
3 comments, last by dell96 6 years, 11 months ago

I'm trying to make my first project but I'm stuck i don't know how to make my crate to start to spawn again when i hit the start button after i die.

hoping someone can help!!!

Crate.cs

CrateSpawn.cs

Cratework.cs

GameController.cs

GameManager.cs

You may want to ask questions like these on the Unity Answers site or their forums. Also, I'd recommend quoting the text directly in your posts as it is generally considered unwise to open program files you don't know the contents of on your computer and people will be less likely to read them and assist with your issue.

Advertisement

I did not check the code but what your doing is very simple.

You spawn object in Unity with:


Instantiate(TheObject, Position, Rotation);

https://docs.unity3d.com/Manual/InstantiatingPrefabs.html

 

Most of the time you will want to parent it to some kind of object so that you can remove all the child objects at once. I helped somone with a similar code:

It's 2D but has a spawn code inside: https://www.gamedev.nethttps://uploads.gamedev.net/monthly_2017_11/AlphabetGame_unitypackage.a83d6b211ad7242723fa6d67695074f5

 

Can you describe your problem in more detail? Sorry I don't have the time to try your code as I am at work.

well in my game my objects spawn correctly but when the player hit the objects the spawning stop, and the gameover page shows with the replay button on the bottom when i hit the button the spawning objects don't restart they just stay where they were.but i want to spawn the objects again, like flappy bird if you die you hit the restart button and its starts spawning again  

This topic is closed to new replies.

Advertisement