I’m trying to create a cheat menu that allows the player to control the time of day, weather, etc. I’m using the OnValueChanged event and setting the actor rotation to the slider value. The problem is that the actor reference variable won’t let me change the value to that of my sun blueprint. It just gives me the “Editing this value in a Class Default Object is not allowed” error.
So the issue is that this is a Class Default, not an instance of an object. So you’ll need to set this in-level/in-game once the game starts with a “Set” node.
I suggest doing this on the Level Blueprint on BeginPlay, you can also have an event in your LBP that would run from a signal in your cheatMenu (say, when you open cheat menu, tell LBP to “Get CheatMenu > SET SunActor” And drag in your directional light from the world outliner
Not an expert; however, I did something similar to what Mind-Brain is recommending in that I have the level BP managing the sun, moon and stars positions based on a timer event.
I use dispatchers, for example, in my character and bind a dispatcher to a listening event in my level BP to communicate information from my characters/players to the level BP. To complete your desired data connection, the widget that is managing the sun position cheat would make a reference to the character and call that character’s dispatcher with the slider sun position when appropriate.
I tried your solution in my level blueprint but I am not sure how to get an object reference to my CheatMenu widget, as it does not appear in the level on play, only after a button press. Thanks for your help.
Since this is a CheatMenu and not something used often, I’d suggest using “GetActorsOfClass”, or just using a dispatcher. IF you don’t know how to use dispatchers, I would use this as a perfect opportunity to learn them! They’re absolutely fantastic and possibly one of the top 10 things to know about Unreal, in my opinion.
(When making the dispatcher, it would be located on the cheat menu and you would have an input of “Self” to pass it along to the LBP)