Quantcast
Viewing all articles
Browse latest Browse all 56

Converting this for loop to C#

I'm trying to convert this particular for loop from JS to C#. for (var t: float = 0.0; t < 1.0; ) { t += Time.deltaTime; transform.position = Vector3.Lerp(orgPos, dstPos, t); transform.rotation = Quaternion.Slerp(orgRot, dstRot, t); yield; } What I'm having problem with is the fact that it's looping through a float and also the yield command. I think it means "return here next frame" but I can't seem to find the equivalent for C#.

Viewing all articles
Browse latest Browse all 56

Trending Articles