Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Voting for the Unity Awards are OPEN! We’re looking to celebrate creators across games, industry, film, and many more categories. Cast your vote now for all categories
    Dismiss Notice
  3. Dismiss Notice

need help with fixed Update

Discussion in '2D' started by PersianKiller, Aug 15, 2018.

  1. PersianKiller

    PersianKiller

    Joined:
    Jul 16, 2017
    Posts:
    114
    question 1

    fixedUpdate runs 50 times per second .how can i increase or decrease it?like 100 times per sec.


    question 2
    i have 2 scripts,can i runfixedUpdate 50 times in one of them and in another one more or less than 50 times?

    // script 1 fixedUpdate runs 50 times
    // script 2 fixedUpdate runs 30 times

    sorry for bad English :)
     
  2. barskey

    barskey

    Joined:
    Nov 19, 2017
    Posts:
    207
    1) Edit > Project Settings > Time to change the timestep for the FixedUpdate loop.

    2) If you can make them an integer multiple of each other, then you could set the timestep to the faster rate, and have a conditional in the slower FixedUpdate loop to evaulate to true every other frame. So you could, for example, have 50 steps and 25 steps.
     
    PersianKiller likes this.
  3. PersianKiller

    PersianKiller

    Joined:
    Jul 16, 2017
    Posts:
    114
    nice ,thanks man :)
     
    barskey likes this.