Search Unity

  1. Unity 2020.1 has been released.
    Dismiss Notice
  2. We are looking for feedback on the experimental Unity Safe Mode which is aiming to help you resolve compilation errors faster during project startup.
    Dismiss Notice
  3. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

Time.timeScale best practices

Discussion in 'Scripting' started by TheAlchemist42, Jul 15, 2009.

  1. TheAlchemist42

    TheAlchemist42

    Joined:
    Apr 17, 2008
    Posts:
    68
    Hi. I am working on a project where we commonly speed up/slow down the animations on the screen using Time.timeScale. I have noticed that sometimes (fairly random-seeming), when things are running very fast, like timeScale over 10, certain things are failing.

    One of the obvious things that I have found is that messages that are sent with BroadcastMessage() will occasionally get missed. There are multiple scripts listening for these messages, and sometimes one or more of them will fail to receive or act upon the message. Therefore, I guess that the message is being sent, but for some reason, it is not getting received.

    Another issue is that some of the animations which are run using Animation.Play() or Animation.PlayQueued() either do not play at all or only play partially. So, a model that has a 10 frame animation will almost always play all 10 frames. But sometimes it will stop at frame 3 (or any other frame).

    Has anyone seen problems like these? More specifically, is there any way to avoid them or work around them (apart from not speeding up the timeScale which is not an option)
     
unityunity