Hello everyone,
I want to make a automatic cycle for street lamps, when it’s day, the lamps are switched off and when it’s night, the lamps are switched on.
Like this :
(Google Image)
How I could make a system like this with the blueprints please ?
Thank you in advance and have a good day !
The just need to look at the rotation of the directional light. When it’s below the horizon, turn on
Better to do it on a timer, than tick
You might need to fiddle with the parameters a bit…
Thank you.
Will it work if i reproduce this picture ?
I’ll manage this.
What if I get an Overlapping, cast shadow disabled error ?
I have a error on blueprint, the called function Switch On and Switch Off must have a target.
should i cast ?
I can’t
The street light needs to be a blueprint, this is all happening inside the blueprint
I didn’t show you that bit, because I was assuming you already had an on/off piece of code…
Very good. All of it goes in there…
Yes but i have target errors in level blueprint, shown above.
None of it goes in the level BP, all that code goes in the light…
I just understood, thank you.
I will move the code.
Sorry.
1 Like
I think you have more than one copy of the engine open?
BTW: Here’s a more reliable way of checking the sun angle
1 Like
No. But i think it’s good.
Allright, very useful, thank you.
1 Like
I have no more errors but I have to put the angle of the sun to see if it works.
You can play in simulate mode
Which lets you move the sun rotation ( and do lots of other editor things, while the game is running ).
It’s not working, the lamp is stay off.
and then it’s strange, it works on a certain angle but not others. for 20 degrees it works but for 15 degrees not for example, and then the lamps light up while the sun is at 45 degrees and not 20.
there is a mathematical contradiction, I indicated that the lamps must ignite when the angle of the sun is equal to 0. However, the lamps ignite at 45 degrees.