Search Unity

How to control time for all navigation

Discussion in 'Navigation' started by greyhoundgames, Apr 28, 2019.

  1. greyhoundgames

    greyhoundgames

    Joined:
    Jan 24, 2014
    Posts:
    32
    I cannot see a way to adjust the speed of time for all navigation.
    If I were to use timescale, then all the UI will slow down as well.

    Think of an RTS with a gamespeed control. Run at half speed, pause, full speed etc.
     
  2. Yandalf

    Yandalf

    Joined:
    Feb 11, 2014
    Posts:
    491
    There's no such thing unfortunately, TimeScale affects all time-dependant code and there's no way to set the TimeScale for separate systems.
    That said, if you want all of your game logic to speed up/slow down, TimeScale is the way to go. Instead you'll have to make sure all systems that shouldn't change such as your UI don't change. If you're using animations and such for them, don't. Instead write your own linear interpolators for them, using RealTimeSinceStartup.
    As the documentation for TimeScale states, TimeScale affects everything except RealTimeSinceStartup.