Example: Bed
UE5 Time of Day Blueprint System Version: 2.0The bed example found in the Demo/MapHelpers/Bed/ folder will show you how you can jump to a specific time using an object in your world while using a UI to mask the harsh visuals that come with swapping time immediately.
Setup the Bed
There are two parts to the bed, the BP_Bed is the item that appears in the world, and the AC_BedTime is the component that this BP_Bed blueprint interacts with to change time as well as show us a little UI.
First drop the bed blueprint (BP_Bed) into your level. Then if you are already using the AC_TimeOfDayUI you are all finished. The AC_TimeOfDayUI will handle adding the AC_BedTime to your level’s player controller for you when it sets up the time HUD UI. However, if you are not using the AC_TimeOfDayUI you will need to manually add the AC_BedTime to your level’s player controller.
The bed will yell a print string at you if you try to use the bed and the AC_BedTime is not found on your current player controller. You can also add this AC_BedTime component at runtime if using the bed is a feature you want to let your player unlock after a certain progression requirement is met in your game or level.
Now if you do not have a player controller (this is not the same as a player character) you will need to make one before using this feature.
If you are actively developing your project and you do not have a player controller yet there is a high chance that you are using your character pawn for a lot of the stuff that you should be doing inside your player controller.
This is a common trend amongst beginners, and if this is the case with you I would recommend taking a little bit of time and learning the difference between the controller and the pawn character.
Configure the Bed
The bed has a few settings you can use to further customize it. Select your bed then from the details panel navigate to the default section to change the following settings:
Real Time Mode
This example and jumping time in general was created for the Custom Time mode to use with Real Time Mode you will need to remove the ContinueIfCustomTime macros in the BP_TimeOfDay.
Most Common Issues
99% of the time the reason it does not work is because your player controller does not have the AC_BedTime component on it.
This component is added automatically if you are using the AC_TimeOfDayUI but if you are not using it, or removed it, you will need to manually add the AC_BedTime component to your player controller. If this is missing you should see a print string telling you so when you attempt to use the bed.
The other 1% of the time the issue is related to collisions, typically when custom collision responses have been created for the pawn. To fix this, verify that the sphere collision on the bed is set to overlap the collision type used on your pawn.