Hello,
I have a script that will eventually be used to create a jittery transform of scale,rotation etc… for text on my main menu screen.
I have used a coroutine to create a looping scale (scale up and down repeatedly)
I would like to attach this script to each letter in the words “Main Menu”, so each letter will scale at a slightly different time than eachother.
So my thought was to create a public variable that I can specify a unique delay on the initial start of the coroutine for each letter. (“M” kicks off at 1/2 second, “A” at 1 full second , “I” at 1.5 seconds etc…
At the start of my script I define the following:
// This is the time it takes to scale up/down and the delay before scale starts
public float duration = 0.05f;
public float waitdelay = 1.0f;
If I use the following lines, the delay works in the script:
public IEnumerator ScaleJitter () {
yield return new WaitForSeconds (1.0f);
It works as expected, however if I change it to:
public IEnumerator ScaleJitter () {
yield return new WaitForSeconds (waitdelay);
It does not work. (Not only does it not pause, it does not run the coroutine to scale at all.
What am I missing?