Hi the script below is for a tapping game so when I tap on the object this is attached to it will disable the renderer and set Time.timescale to 0.4 which gives it a slow motion effect and it does but it lags making the objects fall look like their scraping the back background(their movement is really laggy). Any suggestions on how to make it a smooth slow mo effect?
var explosionPrefab : Transform;
var audioTap : AudioClip;
function OnMouseDown () {
if (gameObject.tag == "BubbleSlowTime") {
var boom : Transform = Instantiate(explosionPrefab, transform.position, Quaternion.identity);
gameObject.renderer.enabled = false;
audio.PlayOneShot(audioTap);
Time.timeScale = 0.4;
yield WaitForSeconds(0.6);
Destroy(explosionPrefab);
yield WaitForSeconds(2.0);
Time.timeScale = 1;
Debug.Log("Slow Time");
}
}