Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

How deterministic is unity?

Discussion in 'General Graphics' started by DoomDude99, Jun 9, 2019.

  1. DoomDude99

    DoomDude99

    Joined:
    May 11, 2019
    Posts:
    87
    This may be a rhetorical question, but if I generate a set of 3D objects that interact with one another in a way when the game starts (for example, bowling ball smashes through table), will this behavior be consistent across all runs provided the objects and environment remain constant?
     
  2. halley

    halley

    Joined:
    Aug 26, 2013
    Posts:
    2,363
    Doubtful. Even if you never use Random or carefully seed every RNG, there is the problem of measuring time on non-realtime platforms. This feeds into physics calculations, and results are chopped into single-precision floats.

    If you need this kind of determinism, record animations once and just play them back. There are some tools to assist that on the Store.
     
    DoomDude99 likes this.