- Home /
Frame Rate Issue
Hello everybody,
something weird is happening when I run my game (or even after building it), the game keeps giving little frame drops like this
it's like it's 60-60-60-11-60-60-60-1-60-60-60-11and soon
I don't know why or this happened since it has started to happen just right now today
if you have any answer please post it here I'm very experienced and smart don't worry
thanks in advance.
Uhm, it's hard to interpret your "graph". What does it represent? The frame time for each frame? Your roman numerals also don't make much sense as they basically say 1,2,3,4,4,3,5,6,7,8,9,8,7,11,12. The usual order is I, II, III, IV, V, VI, VII, VIII, IX, X, XI, XII, XIII, XIV, XV, XVI, ...
Also if the graph shows the frame times in "ms" it would mean you get a frame rate of 40 fps and at the spikes only 20 fps.
If you get a cyclic framerate drop it has to be something "cyclic". A common case would be the physics system (FixedUpdate) since it usually runs at a lower rate than the normal Update. By default the physics rate is set to 50fps (0.02sec or 20 ms). Since your frame time is larger than the time required for one physics step, Unity will have to call FixedUpdate multiple times per frame.
With the information given we can only guess what you're doing in your game / application. You should edit your question and add more information. For example if you're using the physics system, how many objects you have in your scene, etc... Just presenting symptoms without any information on the possible causes makes it impossible to give an answer.
hi @Bunny83, first thank you for correcting my wrong roman numerals
what I meant in that question is that the games run at 60+ frames per second but It give little freezes and hangs during runtime for example ...
if you are walking down the street at your normal speed and suddenly stop for 1/10 of a second then continue moving at your normal speed.
if you know what I mean please reply
thanks in advance
here are some more screenshots from the profiler if this helps
2 screenshots showing all of what was happening
Answer by WinterboltGames · May 22, 2017 at 09:16 PM
No problem I have solved it myself
here's how to anyone having the same problem:
I had about 50-60 spawning scripts looping ray casts I have fixed this problem by making them all united under single caster that casts the Ray once
also thanks for @Bunny83 for this:-
If you get a cyclic framerate drop it has to be something "cyclic". A common case would be the physics system (FixedUpdate) since it usually runs at a lower rate than the normal Update. By default the physics rate is set to 50fps (0.02sec or 20 ms). Since your frame time is larger than the time required for one physics step, Unity will have to call FixedUpdate multiple times per frame.
With the information given we can only guess what you're doing in your game / application. You should edit your question and add more information. For example if you're using the physics system, how many objects you have in your scene, etc... Just presenting symptoms without any information on the possible causes makes it impossible to give an answer.
Answer by MrJamieMcC · May 23, 2017 at 06:47 AM
Are you spawning any objetcs?
yes, but the problem wasn't in the spawning but in the ray casting it self since i have pooled all the objects that are spawned.
Your answer
Follow this Question
Related Questions
Increasing Unity Frame Rate? 0 Answers
[Android] Debug vs Release build FPS 0 Answers
Odd FPS in Editor & Built game. 0 Answers
Sudden Framerate drops at random times?? 2 Answers