Search Unity

Bug Need SpriteShape callbacks for when it is generated, but how?

Discussion in '2D Experimental Preview' started by Discipol, Jun 13, 2019.

  1. Discipol


    May 6, 2015
    Hi! I am procedurally generating a racing track (with an automatic linerenderer) and I need to wait for it to finish before I remove a black overlay and allow the player to take control of the car.

    The track length differs from run to run so I can't just wait ... I dunno, 5 seconds and assume it is done. Every now and then I start too early and the SpriteShape does not exist.

    I snooped around and found Job logic around but the creation starts inside "OnWillRenderObject" and I have no way to access it.

    I wish there where some Action or UnityAction as callbacks for when the track is done creating. Or perhaps there's something with Jobs that I am just not aware? I don't know but I really could appreciate your help <3
  2. Venkify


    Unity Technologies

    Apr 7, 2015