I've got a timer that starts at 0 and resets at 24. i.e. a 24 hour clock.
Now I want some objects to be visible at a given range. For example an object should appear after 8 and hide after 20. This is easy, I can just check if the time is greater than 8 and lower than 20.
But, if the object should appear after 20 and hide after 8, it becomes a little more complicated. As the timer can be greater than 20, but it is not lower than 8 - not until the clock resets to 0.
Maybe there is some math formula I can use? Something that returns either a positive or negative value if the time is inside or outside of the range?