- Home /
Unity 2D: How can i delay my clone for few seconds?
Hello everyone
So i am cloning my gameObject(Rock) and i want it to wait a few seconds(3-4) everytime it spawns. Either wait for few seconds after spawning or spawn after few seconds when it exits the gameScene.
so i have attached the Script i am using for my gameObject(Rock).
Does Coroutine come in handy? i am a bit new to unity so i would really appreciate the help guys! :D
Thanks
SCRIPT IMAGE >>>> https://drive.google.com/open?id=1kICUCqW_t6hDLgEJWMF7SGjOj2Ar2hp_
Also, if anyone need more info please let me know i will provide it!
Last question, i am getting "Error parsing the uploaded file" when attaching image in the website, is this website's fault? i been getting this error for quite a while now and have to use google drive instead, not a big problem but still if this could get fixed it would be helpful!
well, please help me with my query. Thanks
just tagging few of ya'll so you get notified
@Bunny83 @Eric5h5 @robertbu @thor348k @rufopufo and everyone else :D please help
Answer by basboogaard89 · Jul 07, 2019 at 09:11 AM
You can indeed use coroutines to wait after spawning an object. Check this page in the docs for examples of how to implement and call coroutines: https://docs.unity3d.com/ScriptReference/MonoBehaviour.StartCoroutine.html
(Use this in combination with Instantiate (https://docs.unity3d.com/ScriptReference/Object.Instantiate.html) but based on your question you've already got this working )