Author Topic: Time step by frames?  (Read 662 times)

Peanut

  • Guest
Time step by frames?
« on: June 07, 2020, 12:25:54 PM »
I have my game locked at 60fps and would like certain trails to only show up every 5 or 6 frames or so.  Is there a way to adjust this so the trail isnt showing up 60 times in 1 second?

Kronnect

  • Administrator
  • Hero Member
  • *****
  • Posts: 6214
    • View Profile
Re: Time step by frames?
« Reply #1 on: June 07, 2020, 10:49:31 PM »
Hi,

You can try to skip either the creation of new trail frames or the rendering of the complete trail.
Edit TrailEffect.cs and locate the LateUpdate() event.

Add this line before AddSnapshot() call:
Code
            if (Time.frameCount % 5 == 0) 

So AddSnapshot() method is called one every 5 frames.



Peanut

  • Guest
Re: Time step by frames?
« Reply #2 on: June 09, 2020, 04:14:29 AM »
Wow great, that was exactly what I was looking for.  Thanks!