Answers for "Execute code every x seconds with Update()"

C#
1

Execute code every x seconds with Update()

private float nextActionTime = 0.0f;
 public float period = 0.1f;
 
 void Update () {
     if (Time.time > nextActionTime ) {
        nextActionTime += period;
         // execute block of code here
     }
 }
Posted by: Guest on June-25-2020

Code answers related to "Execute code every x seconds with Update()"

C# Answers by Framework

Browse Popular Code Answers by Language