First you need to create a dynamic material instance of your material in Construction Script, like so;
And then, head to Event Graph and get that variable you set. Drag from it and find Set Scalar Parameter Value(or Vector if that’s what your parameter is), set the parameter name and connect the nodes as you see here;
Now whenever you press the key the timeline will gradually increase the parameter value and then reverse when you release the key.