Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
  • Help Room /
avatar image
0
Question by NMGaudreau · Jan 12, 2017 at 06:26 PM · animationtimefixedupdate

Best way to update at a regular interval?

So, I'm making a fighting game that requires everything to update on a frame by frame basis. That means everything has to update every 1/60th of a second without fail, and that means animations as well. I was using FixedUpdate but some reading lead me to believe that it's not as reliable as the docs made it sound.

So my question twofold: 1) What would be the most efficient way to handle updates at a fixed, regular interval 2) Is there a cost efficient way to force the animator to update at the same time as the rest?

Thanks a lot

Comment
Add comment · Show 1
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image agentc0re · Jan 12, 2017 at 08:33 PM 0
Share

You're best bet is to use Update. It's called once per frame. https://docs.unity3d.com/$$anonymous$$anual/ExecutionOrder.html

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by Pengocat · Jan 12, 2017 at 08:43 PM

You cannot guarantee 60 frames a second, but you may down prioritise things that are less crucial to skip some frames so you're more likely to stay on or above 60 frames a sec. A good practice would be to keep the overall workload of the GPU and CPU at a somewhat stable level. Spikes should be dealt with when optimizing.

Comment
Add comment · Show 2 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image NMGaudreau · Jan 13, 2017 at 02:37 AM 0
Share

That's all well and good, but unfortunately even keeping a solid 60 fps does not mean FixedUpdate will fire at fixed intervals. And I absolutely need an update every 1/60th of a second

avatar image Pengocat NMGaudreau · Jan 13, 2017 at 03:02 PM 0
Share

It is a limitation every game developer has to deal with. There is no magic way of getting 60 fps but when dealing with time sensitive calculations like physics it can guarantee that it will perform its calculations a fixed amount of times by time passed since the last frame. So if you have 30 fps Fixed update would be called twice every frame etc. As far as I'm aware Unity handle the Animation update in the same thread as $$anonymous$$onobehavior. Only PhysX and perhaps sound is handled in other threads.

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

162 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Animation Won't Play Before My Time Freeze. 0 Answers

Make something happen at a specific time in a looping animation 1 Answer

Maximum Delta Time 0 Answers

HELP,Watched tutorial https://www.youtube.com/watch?v=Xnyb2f6Qqzg 1 Answer

Why is my animation being started, but is not actually playing? 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges