Is Time intended to work differently for Widgets?

I’m a vfx artist who has been doing a lot of UI stuff recently.

I’m quite used to using the time node in materials and injecting a start time from blueprint in order to have material effects start and do something over time on command. Along the lines of this type of behaviour incase I didn’t describe it well enough: [link text][1]

I noticed today while attempting to create some effects in a UI material, that time seems to be represented differently on materials used in Widget Blueprints than it does on materials used on HUD Blueprints, or on static meshes, or particles.

I’m wondering if this is a bug, or intentional, and if it’s intentional what the reasoning is behind it.

What happens is:

  1. Materials using Time generally seem to report the time in seconds since the game has started. it resets when you click the play button in the editor
  2. Materials on Widgets, specifically, using Time seem to report the time in seconds since the editor was launched. it resets only when you launch the unreal exe file.

See the below image:

  1. The number on the left is using a draw material node to draw a UI material in a HUD (specifically on the Hud_forPhysicsDemo in the Content Examples
  2. The number in the middle is using a surface material on a cube in the scene
  3. The number on the top right is using a UI material on a widget

Not sure, but look logic to me, as widget exist on the editor side too.

Hello,

We’ve made a switch to a new bug reporting method using a more structured form. Please visit the link below for more details and report the issue using the new Bug Submission Form. Feel free to continue to use this thread for community discussion around the issue.

Thanks

After some experiments - the time displayed in a widget material appears to be what you get from the UGameplayStatics Function “GetAccurateRealTime”.

void UGameplayStatics::GetAccurateRealTime(int32& Seconds, float& PartialSeconds)
{
double TimeSeconds = FPlatformTime::Seconds() - GStartTime;
Seconds = floor(TimeSeconds);
PartialSeconds = TimeSeconds - double(Seconds);
}

1 Like