How do I reset a time node in a UE4 Material [SOLVED]

I’m trying to build an effect where when a drumstick hits a drum a transition shader plays from the top and the drum changes colour. However, My current materials maths engine doesn’t reset when the material is changed so when the stick hits the drum the material changes and the transition is already halfway down the drum.

My Blueprint setup is pretty basic, it just detects an overlap and then changes the material.

The shader graph uses some kind of crazy maths that I wrote a year ago and forgot how it works so that probably isn’t helping things. But the time node goes through that math and makes an alpha for a lerp between two textures.

I’m fairly certain that resetting the time node is what will make this work as I’m intending it but I’m not sure how I would build that.

Things I’ve already tried is adding in a sine node between the time and the FMOD and multiplying the time node by 0 and switching it to 1 when the change triggers.

Don’t use time. Make your own variable that you increase on tick. Feed that into the material. You can reset that as you wish.

That worked great! Thanks for the help.

How do you use tick in the material editor?

  1. Make a float parameter (constant -> rightclick -> make parameter)
  2. In a blueprint, make a float variable, make it increment with deltatime on tick.
  3. Make a reference to a dynamic material instance in bleuprint, assign where you want it to display.
  4. Also on tick, set material parameter on the dynamic material instance to the float variable you made earlier.

Thank you very much sr

1 Like