Hello!
I am trying to set up a dynamic day/night system using the sun position plugin but am having some trouble.
I have set up a timeline to go from a value of 0 to a value of 24 for the hours, but something is going wrong.
When I add the current hour to the value from the timeline (1 - 24) it doesn’t work properly. After a few seconds the hours rapidly increases - even reaching into the hundreds, and I’m not sure why.
If anybody could find a solution I would be very grateful!
Each frame, a gradually increasing value between 0 and 24 is output, but you’re summing them, which is why your total figure is going crazy. You need to plug the truncate directly into the ‘set’ without using the + node.
Then it will work, but I think you’ll find it will jump one hour each second over 24 seconds ( that’s what your timeline says ).
Is it possible to set the plugin with a float? ( much better ).
Thanks for pointing that out! The only problem is that I’m trying to make the hour start from a certain value. If I remove the + node, the hour will always start from 0, instead of whatever value I want to start with.
Does the plugin take a float for the time? If not, you might as well use a for loop to set the time, and you can start this from what ever value you want…
The plugin only takes integers as far as I know, but it’s split up into hours, minutes and seconds.
I want the hours to increase by one per second, but I don’t know the best way to do that.
Hmm, don’t really understand how it can get that info from an integer…
In any event, I think you already have what you want because the timeline takes 24 secs. One hour per second…
If you are sticking with integers, then you might as well use a loop. You can do it like this:
( excuse my fake update sun call… ) At least this way you’re only calling the UpdateSun 24 times, with the timeline you’re calling it about 2880 times ( no kidding ).
Thank you sooooo much! This is exactly what I needed!