hi there!
I want to create a menu button to start a fast day-night cirlce.
i have allready add a rotation timeline in my levelblueprint. (from this tutorial: Unreal Engine 4: Day night cycle using Blueprint. - YouTube)
When i start now the level, the time starts moving and the sun and light circles begin.
Can i trigger this special event by click on one Button? so that the circle starts not at the levelbeginning.
In your level BP, get all widgets and cast to your widget with button and get reference to that button. On this button’s onclicked event you can bind an event i.e. your time line.
ok, that works, but only for the first menu (the menu direct after the “game starts event”).
when i want to connect another widget-menu, than nothing happens.
it seems that the time-code in the levelblouprind works only for the very first beginning of the game?!
Create your “BeginMenu” widget in BeginPlay event of your “GameMode”. In level BP start from the node marked green above. Add above nodes to Gamemode.
When you create beginmenu widget, store the return value into a variable e.g BeginMenu reference.
Go to your BeginMenu widget and then go to clicked event of button. Get reference to your gamemode “Get Gamemode” and get BeginMenureference. and remove it from viewport using “Remove from parent” node and after that node add your Menu widget in the viewport.
here a picture of my levelblueprint. when i change the “create menu widget class” from “BEGINMENU” (first menu of my game) (red circle), to “MENU” (second menu of my game) it works. But then this widget will load at the gamestart!
Buit I want to start the game with the BEGINMENU widget. After a buttonclick the “MENU” widget appear. From this widget i want to control the day-night-circle.
You are using some SA button in your Menu widget as I can see in your screenshot above. When you go to your MENU widget and select that SA button, then you will find Events in the right sidebar where you have to select OnClicked event.