What is the proper way to Lerp between 0 & 1 for an exposed Shader Graph property using Bolt?
I have an exposed ‘Lerp’ property in my #Unity3d URP Shader Graph. I have a “Toggle Unit” & a “Material Set Float Unit” in my Flow Graph. They don’t link up/communicate with each other properly.
What am I doing incorrectly? Your experience, insight, and willingness to help are greatly appreciated; so thank you!
The name you want to use is not the Name field in your shader, but is the Reference field.
So instead of Lerp, you want _Lerp

Thank you, ericb_unity,
Funnily enough, I learned from a video tutorial to begin my references with an underscore. The video even clearly states the purpose of doing so is to gain access to the property from code. The very same video that taught me so well … was the very same video that led me down the path of improperly using ‘Lerp’ in place of ‘_Lerp’. Oh cruel irony.
I should have put two and two together; I simply did not.
Can you point me to a good resource for learning to smoothly transition over time between the two floats?
Tutorials have led me down the path of using a Bolt Lerp Unit combined with a Time.DeltaTime Unit + a Divide Unit, but this isn’t working. The problem with Youtube, for every 1 working tutorial there are 19 that don’t work or are immensely obsolete.
Ok, the way I’m showing may not be the best, but it is understandable and it work with your current scenario. So, I made 3 examples. Using the Cooldown node, to make sure the action can’t be achieve until it is completely done.
1- Using a lerp function to do the interpolation. like what you are trying to use.
2- Using a curve to do the interpolation. I do prefer using curves, because it can be modified by users and saved. You can make fancy ease-in, ease-out with those.
3- And the final example with a curve and a toggle so your value can interpolate from 0 to 1 and from 1 to 0.
This is how it look like with a custom shader having my lerp value set on the alpha.