What is "Clock Control VFX" and how to use it?
-This appears to be a clock, but there is no documentation anywhere on how it functions. It doesn't appear to start a timer automatically.
How do I attach the Sun Object to a script to control its orbit?
-I get an "Attempted to access an object that has been destroyed. Consider using Object.IsValid(myObject)"
-Solved in script-
I am trying to design a time system and I am having some trouble interacting with objects. I have a sphere in the scene for both the sun and moon. The moon is blue and sun is brown in the image and they moon is overlapping the sun.
I am trying to orbit the sun and moon around the map based on the time system. I have grouped both the sun and moon in a client folder and offset the horizontal axis by 100k pixels.
Since the client folder is located at [0,0,0] when I rotate the client folder it will cause the sun to orbit on that focus point.
I'm guessing for perspective it would probably be better to attach the sun to the player --- one step at a time.
It appears I will need to separate the moon to have it orbit independently.
You can see from the viewport image the working clock is displayed with the UI display on screen.
The way I figured it was 360deg equals 1 day. There are 1440 minutes in a day. 360deg/1440min = .25 deg rotation each minute or 1 degree every 4 minutes.
I am attempting to orbit the sphere at .25 degrees per minute.
I figure once I complete this system I will be well on my way to scripting and coding in Core. This is my first attempt at a script. I know there must be a better way to write this. If you feel compelled to instruct me on a more efficient way I would be happy to learn.
Yes I noticed there are other scripts.
I also realize that having this in the tick function may not be ideal.
I have a working version for any one interested and U have updated the script. in the post. however It orbits fast and I will update when I get it working better.
I am absolutely no expert, but I've used the DayCycleController from Farmers' Market in another game. The main script DayCycleControllerClient includes extensive programming connecting the system clock to the moon, skylight, sun light, sky dome assets. Length of Day is a custom parameter at the folder level that in turn controls the degree of the sun, etc. The script also broadcasts four time points (dawn, noon, dusk, midnight) that in turn control the audio assets, the Sundial Dynamic UI, and whether you can see the light/flame in the lanterns. Have you studied how these scripts work?
I'm not any sort of programmer. I've only gone through the basic LUA lessons. I can tweak scripts and sometimes can mush them together.
I came to the forums today hoping to find the right place to ask how to use the DayCycleController time point broadcasts to control respawning of assets. Just mimicking the programming used for visibility/non-visibility of assets doesn't do it.
Actually I have been here for 3 days.
I am no programmer either, however I would like to learn and just looking for a fun way to do it. Ive Got a long way to go.
I have looked at similar scripts that broadcast 4 time sequences, but what if you have an rpg where doors to building are are closed between 8pm and 6am? Those 4 broadcasts may not be specific enough.
I have seen all the sky components and plan to include all of them if I actually succeed at building something.
Thanks for the tip of Farmers Market. I have not played farmers market yet. Ill take a look in that project to see how it was done.
You can probably replicate one of the bits of programming in DayCycleController to recognize a different period like 8pm to 6am (6 pm to 6 am is super easy, since it just combines two existing time quadrants). To lock doors, however, you'd have to turn off collision (whether for triggers if you're using the doors out of Core Content or for the spawned collision cubes if using the door system from the survival game framework). That's exactly what I'm having trouble accomplishing and will be asking in a new thread.
Best of luck!