- Home /
Repeating actions with frequency and shape (LFOs)
Hi everyone -
I'd like to add another feature to a project I'm working on and still learning the ropes. This time I'd like to take the HeightMap texture value from a plane and "oscillate" it, from one value to another, according to a specific frequency. I've seen some code that uses wait-based, sequential commands - but I'm wondering if there is a way for the motion to be graphed along a waveform - such as a sine or a sawtooth shape. I'd be very grateful for a demonstration, if someone would be willing to provide one.
you seem to have the answer in the question. If you want your map to oscillate with sine then use it. Simplified version:
map.y = $$anonymous$$athf.Sin(Time.time * frequency) * amplitude;
where amplitude is the max value it should reach.
Answer by pankocrust · May 31, 2018 at 07:26 AM
Ah, Mathf helps a lot. Thank you very much...What about setting that to the height map parameter?
Specifically, I'm not actually sure what the Height$$anonymous$$ap parameter even is - there's a slider with values ranging from 0.005 to 0.08, but I have no idea how to access them.