r0128 r0128 - 1 year ago 83
C# Question

IEnumerator not working

for some reason the motionBlur

is not being called... where is my mistake?

public void Dash(){
lastDashTime = Time.time + dashWaitDuration;

motionBlur ();

animator.SetFloat ("Speed", 0);

playerRigidBody.MovePosition (playerRigidBody.position + transform.forward * 1.75f);

IEnumerator motionBlur(){
print ("Hello");
camMotionBlur.jitter = 10;
camMotionBlur.enabled = true;

yield return new WaitForSeconds (2);

camMotionBlur.enabled = false;
camMotionBlur.jitter = 0.125f;

Answer Source

You need to use Start Coroutine then it should work.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download