Quantcast
Channel: Questions in topic: "moveto"
Viewing all articles
Browse latest Browse all 116

How to make your script wait until function finishes

$
0
0
Greetz, i need a bit of help I m having a hard time for a few days allready figuring out how to execute multiple iTween.MoveTo functions. Basically, i need my script to wait for the iTween.MoveTo to finish moving and then proceede to next stuff. Simple example: iTween.MoveTo(tile.gameObject, iTween.Hash("position", destination1, "time", 2f)); //now here script has to wait until upper iTween.MoveTo finishes moving iTween.MoveTo(tile.gameObject, iTween.Hash("position", destination2, "time", 2f)); In this case, second iTween.MoveTo "kills" first one and only second one is executed. I tryed to make it with delay property of iTween.MoveTo, but then other kind of problems occur, i.e. MoveTo waits but gets wrong destination point since destination is calculated too early. I tryed with yield but no results, i dont understand that concept quite well. Anway, i need my script to wait (not completely freeze) until iTween.MoveTo finishes, how could i do it, maybe make a separate thread and then stop one until other finishes or.... ? Plz help.

Viewing all articles
Browse latest Browse all 116

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>