Quantcast
Channel: Questions in topic: "loops"
Viewing all articles
Browse latest Browse all 184

How can I fix my loop steps to the framerate?

$
0
0
Hi, I'm new to Unity so I apologize if my question is posed poorly. I want to use a loop to execute the following until a condition is met: `transform.Translate (Vector3.right * (Time.deltaTime * speed));` However whenever I do so, rather than translating the object at a rate of speed per second it steps through the entire process before the frame can end. Is there a way I can set the loop to execute one step per framerate? Or perhaps I'm being silly and there's a much better way to do this. I assume what I really need for this is a timer but I'm not quite sure how to set one up other than putting a pause in each step.

Viewing all articles
Browse latest Browse all 184

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>