Time factor is changing and getting wierd when I leave the Unity program open too long

I am having an odd problem. I am working on a 2d game. I have some sprites that I am having move on a preset pattern using lerp.

To be exact here is one of the statements:

this.transform.position = Vector2.Lerp(this.transform.position,Vector2(this.transform.position.x-1,this.transform.position.y) , speed);

If I open Unity (Windows 7 / Unity 4.6) at first everything works exactly as I programmed it. But after Ive been working on things for a couple of hours or even if I just open Unity and walked away for a few hours and came back to it, all the sudden the sprites that I have moving using the lerp function no longer move the normal way. They start moving much faster or in other sporadic and odd ways. Also I don’t think its just lerp I have a sprite moving using a

this.transform.Rotate (Vector3.forward * -1);

and after a while it starts rotating in jerky ways vs smooth.

Whenever this happens all I have to do is restart unity and everything works normal again, at least for a while.

What is very strange is I need to close Unity and restart it to fix it. If I just hit the play button again things are still weird. I would think every time you hit the play button it should reset all the variables and start the game fresh, so it does not seem right that I need to close the program and restart it to get back to normal.

Does anyone know what might be causing this?

Well, I seemed to have figure it out. The problem was the move scripts needed to be in Fixed Update vs Update. That made all the difference.

FixedUpdate should be used when dealing with physics, like applying force to a rigidbody.

You can just multiply your speed by Time.deltaTime inside the Update function

http://unity3d.com/learn/tutorials/modules/beginner/scripting/delta-time

Definitely don’t use FixedUpdate if you’re not using physics. It doesn’t match the screen update rate, so it won’t look as good.

–Eric