tick rate problem…

Hi, simple problem, let’s say I have a GameObject that instantiates 1x1x1 cubes at it’s position on every Update(). Now I move my GameObject. it now builds a wall. the problem is, if it moves faster than 60 units per second, the wall has gaps :confused:

How can I work around this problem?

Worst case: how can I tick faster in unity? :smiley:

You can't make Unity go any faster than "as fast as possible", which is what it does when vsync is turned off. Note that turning off vsync won't fix the issue; at best it will reduce it.

1 Answer

1

I see 2 solutions to your problem:

  1. Use FixedUpdate - it is periodic update (for physics) and you can set the frequency.

  2. Make your code frame rate independent by calculating the delta distance per frame and “fill” it up with a variable number of cubes.

I would go with the later solution.

Btw. you might not always have 60 FPS.

Kind regards,

Keld

FixedUpdate won't solve anything; the correct answer is to fill in the gaps. You can use this code as a starting point: http://unifycommunity.com/wiki/index.php?title=TextureDrawLine

went for the second solution :) worked.

Cool. Glad to hear.