UE5 Time of Day Blueprint System
This page is part of the documentaiton for my UE5 Time of Day Blueprint System

Example: Bed

UE5 Time of Day Blueprint System Version: 2.0

    The 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:

    SleepUntilHour & SleepUntilMinute By default the bed will jump to 7:45 when you overlap it. If you would like to change this time you can specify the Sleep Until Hour, and Sleep Until Minute variables. If this point in time has already passed in the current day your character will sleep until that point in time the next day. Under the surface this time jump is handled using the JumpToNext event found on the BP_TimeOfDay blueprint.
    BlanketMaterial This is the material you want to appear on the blanket, by default it is the same material used on the Cupcake mesh. The blanket is using Unreal’s built in cloth solver since this was the easiest way for me to make a half decent looking blanket since I am not a 3d artist, know your limits people!
    MattressMaterial This is the material shown on the mattress. By default it is using one of the engine content materials.
    PillowMaterial This is the material shown on the pillow. By default it is using one of the engine content materials.

    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

    Timmy Dynooooo ... It doesn’t work.

    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.

    Collisions are one of those things you will have to know about in Unreal, and if you don’t know about them yet now is as good of a time as any other to take some time and learn more about them and how they work in Unreal.
    This documentation and asset version are new. If you encounter any bugs or if anything doesn't make sense, please let me know.