Platform Pulsing Mechanic Not working

Hi,

I am in the process of developing a game mechanic where a hovering platform alters its color within a certain timeframe before disappearing. I found a method on YouTube that uses a Time node and Sin node within the material to create this effect. I have defined parameters such as “Frequency”, “Intensity”, and “Color”

Then, in the parent blueprints for the Platform, I added a ‘Create Dynamic Material Instance’ node to change the material parameters directly from the blueprint. I use a Timeline for this, which includes two keys, from 0 to 1. The float value gets updated via a lerp node between 0 to 3, after which it’s sent to the ‘Set Scalar Parameter Value’.


However, I am encountering a problem. As can be seen in the video I’ve linked, the color pulsing works well initially. But when the timeline reaches the end, and the ‘Reset Pulse’ event is triggered, the pulsing frequency somehow increases compared to the first cycle. This acceleration continues with each subsequent reset until the frequency becomes significantly fast

Any assistance in resolving this issue would be great!

1 Like

Can you show what’s in the timeline? Does that ‘pulse frequency’ pin go from 0 - 1?

Hi @ClockworkOcean

Yes, 0 to 1. Screenshot here.

If you watch your vid, the lerp still goes from 0 to 3 over 7 seconds. It’s the material that’s wrong :wink:

Time is gradually getting larger and larger. I think you might need a frac node between that and the sin. Not at a machine rn… :slight_smile:

Ah got it. I tried adding a Frac node before the sin node but still the same results.

Is there a way to reset the time node from the Platform blueprint? Or, create my own timer, in my Platform blueprint, that updates a parameter on the material?

I think the frac should be directly after the time node.

It works! Thank you.

1 Like

It’s not quite right, I’m still checking it out… :slight_smile:

Ok, this is it.

You have the time node in the material. Time is always increasing, but for some reason, when we set parameters in the material from a timeline in a blueprint, the time node starts using ‘game time’ rather than ‘material time’.

The solution, is the subtract game time, every time we re-run the timeline, like this

The material is

This is the new variable

and this part just makes the sin wave do it’s job properly. Otherwise it spends most of it’s time below zero, which doesn’t mean anything in materials

I suspect this strange time node functioning is a bit of a ‘feature’ and may disappear in later versions of the engine. In which case, your original method should be fine…

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.