Delay follow direction ?

Hi guys

My object follows other object direction. what I need to do is to make this rotation delay for second or two.

transform.eulerAngles = new Vector3(rocker.eulerAngles.x, rocker.eulerAngles.y,  transform.eulerAngles.z);

Daily for a second or two? I have no idea what that means.

Side note: It’s good practice and a good habit to prefer Quaternions / transform.rotation :slight_smile: I believe when you’re in that habit, you’re less likely to run into (as many) problems, in general.

Daily? Do you mean Delay?

1 Like

haha. That seems quite likely… didn’t even occur to me. Yikes :slight_smile:

OH MY GOOOOOOOOD :hushed:
Yes, Daily = Delay.
Now, get back to issue please

Invoke with a delay or a Coroutine…
:slight_smile:

Example please

YourMethod()  {
// some code
}
// wherever you call the code..
Invoke("YourMethod",2); // 2 seconds

Or …

void Whatever() {
  StartCoroutine(YourMethod());
  }
IEnumerator YourMethod() {
 yield return new WaitForSeconds(2);
  // your code goes here.
 }

After I wrote “Invoke or coroutine” you could have looked those up online… :wink:
Anyhow, now you have a couple of examples.

1 Like

Thank you methos5k. I will try it.

No problem. You’re welcome.