How to let my ai know it night time

Hey guys
I’m still new to ue4 so I could use your help
I have bp for night/day and another bp for ai so I just wonder how can I tell my ai it’s nigh using interface (i didn’t know how to use it all tutorial about using it with sphere or with 3p character)
I mange to do it ( tell my ai it night) by get all actor of class then setting the boolean with even tick but that so expensive since I want to do the same for more ai npc and keep getting ref to the same day and night Bp :sweat:
Any visual help well be great :cowboy_hat_face:


Knowing the sun place lol

1 Like

Thnx u for take the time to help me :hugs:
Yes I did the same as the form by using get all actor
Just I was looking for a less expensive way instead of using get all actor of in ever ncp :sweat_smile:

So if anyone need this
i find 3 way to fix this (not problem just way to optimize) and I end up savi’g 5 fps maybe more maybe less!!
First make a game instance and it it make bol variable and make it public
Then in your day night system cast to your game instance from begin play and set the boolean
And then grab your night or day bol and link them
That the hard part done :clap:
Go to your npc cast to your game instance
Grap the bol from it and but in in branch
here you go
U can fo it also with event dispatcher