Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 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 /
avatar image
1
Question by Borzi · Oct 10, 2013 at 07:26 PM · fpslagtime.deltatimeframe rate

Sudden framerate drops?

Hey, when I am playing my game I sometimes get some pretty hard framerate drops, sometimes from a steady 80 - 90 fps to below 20. I don't know why, they appear randomly and never at specific moments (for example sometimes when the player is just walking, other times when the player is shooting or interacting). They don't occur incredibly often but often enough to notice. I am not sure if this is cause of my laptop or another factor within the game. Any ideas why this could be?

Comment
Add comment · Show 8
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 clunk47 · Oct 10, 2013 at 07:32 PM 0
Share

Very vague question. You haven't specified what type of game, what is in your scene, how many scripts you have running, how many models with how many polies, how much you have going on in general, or even your laptop's specifications for cpu, ram, gpu, anything. Help me, to help you! XD

avatar image ArkaneX · Oct 10, 2013 at 07:32 PM 0
Share

If it happens randomly, then maybe it's worth taking a look at your laptop temperatures? And maybe clean cooling fans.

avatar image Borzi · Oct 10, 2013 at 07:39 PM 0
Share

@clunk47 Sure, my game is an Online FPS, I have quite a few scripts on the player that are running at the same time but its hard to tell how many really and the laptop I am using is (unfortunately) a mac book pro. The scene I am using is just a small scene with just a few blocks lying around, simply to test some basic mechanics. @ArkaneX good idea, I am not sure how to do that on mac book but I will try and inform myself.

avatar image Jamora · Oct 10, 2013 at 07:50 PM 2
Share

$$anonymous$$y money's on a garbage collection slowing the game down. There wouldn't happen to be any code that generates new objects every Update (strings, maybe)? Possibly something that looks like the code samples in Understanding Autoatic $$anonymous$$emory $$anonymous$$anagement?

avatar image MarkD · Oct 10, 2013 at 07:52 PM 2
Share

Well every time I have frame drops I check my scripts/Image effects (image effects are pro only or trial). $$anonymous$$ost of the time it is caused by image effects (with pro you can track them down with the profiler). I often am to ambiguous when setting up image effects causing them do bottleneck my frame rate by using to much resources for high quality and stuff.

Check anything else that might be performance heavy and tweak it down, optimizing a game can take some time.

Show more comments

4 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by Borzi · Oct 11, 2013 at 03:57 PM

Okay so I am not 100% sure on a perfect answer, but I noticed a lot of the lag was reduced after some tweaking, especially when I am not running the game in Unity but when actually running the build, the framerate is pretty steady. Here are the two factors that I think effected it the most:

  • Add some fan cooling to my Laptop

  • Use less static scripts and replace them with "GetComponent" as its faster and requires less CPU

If you have anything else that might help be sure to comment it, I hope this can help some other people who are experiencing similar issues.

Comment
Add comment · Show 1 · 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 nuonical · Jun 30, 2017 at 09:03 PM 0
Share

Unity has a built in profiler you can use to see what those performance spikes are : https://docs.unity3d.com/$$anonymous$$anual/Profiler.html

I would also recommend caching any GetComponent calls in your Start() function, as calling those repeatedly is unnecessary overhead. Additionally, be careful what you put into Update(), and consider using co-routines ins$$anonymous$$d if your logic doesn't need to be called every frame. But first, check out the profiler to see where your spikes are co$$anonymous$$g from.

avatar image
0

Answer by Vetpetmon · Nov 30, 2014 at 07:26 AM

I totally know the answer to your problem. Frame rate depends on these occasions:

To many objects or you have used terrain

Graphics quality is too high

you did not set the expected frame rate code:

     function Awake () {
         // Make the game run as fast as possible in Windows
         Application.targetFrameRate = 300;
     }

note: you can set the frame rate to any number if you want.

networking being used

computer is hot and needs cooling ASAP

need bigger RAM

Or, you computer is just slow

These answers are %100 tested and works. This may help you get the speed of the game you want it to go. Or it might just kill you computer(Overwork it).

Comment
Add comment · 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
0

Answer by DavidVella · Jun 30, 2017 at 08:43 PM

I had frame rate drop when coding for a mobile device. My solution was to modify The Camera Rendering Path to Legacy Vertex Lit which made a whole 30fps difference.

Comment
Add comment · Show 1 · 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 rahulk1991 · Dec 06, 2019 at 09:50 AM 0
Share

Cant believe no one has mentioned this. Improved my FPS by 10 in just one setting! Thanks!

avatar image
0

Answer by hendryshaikh2004 · Mar 09, 2021 at 11:57 AM

Man I have The Same Problem but nothing seems to help, My Game runs smoothly but then suddenly it goes to 0 fps. Can Anyone help?

Comment
Add comment · 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

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

25 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

Related Questions

My Character lags when moving, when i have a custom made blender model what should i do? 0 Answers

3d model with lower poly count than another model causing tons of lag 0 Answers

Android running at 30 FPS 1 Answer

Animation are not fluid in android 1 Answer

Android game LAGS on PORTRAIT but it doesn't lag on LANDSCAPE 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