Capping frame rate with unity 3.5.7

Hi everyone.
I used unity 3.4 to build my android game, but with 3.4 the game does not run on android 4, so i decided to go with 3.5. Now the game runs fine on all versions of android (with a slight fps drop) but i am unable to cap the fps.
In 3.4 setting vsync to every vblank would cap the fps to 60 on the mobile device.
With 3.5 it will just not limit the fps. It works on the editor but not on the device. I am using fastest quality setting for both the editor and android.
To be more specific i build and run on my device (2 different devices) and the result is always as if the “don’t sync” setting was selected (i am using an fps counter script).
Any ideas?

Well its easy. You should never cap the FPS. If you done something that is to fast, you should use real time instead.
Think about it. You make the game for your phone and it works fine. An other person try it on his phone that is older then yours and your game will be very slow. An other person will try it with his phone that is much faster then yours. The game is to fast and he can not play. If you used realtime it would not matter so much on them, as long they can cope with the graphics…

Tnx for the answer Damian but my game is of course frame rate independent. What i mean is that the game play is exactly the same in all devices. I just want to limit the fps @ 60 to avoid fps dips. All i am saying is that for some reason the vsync options do not work for me. It will run at around 100 fps on my lg p990 no matter what setting i choose. This was not the case with unity 3.4.2.
Can someone that uses unity 3.5 please confirm that the vsync settings work for them on an android device?

Can you explain why do you care if the FPS is over 60?
If you make the game right it should not matter.
If it does then it will be an programming error and you DO use FPS dependent routine.
Also do not really on vsync. you can turn that off in android…

i want to limit the fps to avoid dips… for example, the game runs at 100 fps but at some point it can drop to 70 momentarily… its gonna hick up a little bit which is not gonna happen if it is limited at 30 or 60 fps

when i print QualitySettings.vSyncCount in a guitext it shows the right value, eg 1 for every vblank… but still the fps counter shows that the fps is unlimited… application targetframerate does not work either… am i missing something??

What FPS counter do you talk about?
Do you know that all Unity stuff do not work in android?
Also I do not agree with you that a FPS dip should make any impact on a game as long its over 30FPS.
Still if you have problem with a dip from 100 to 70 then something is wrong in your game.
I think you are focusing on wrong things.
Se what source of the problem of your “hick ups”—

i am talking about a script that reports fps… or a an app that does the same. Anyway, all i am asking if this quality setting works or not. it used to work for me in unity 3.4 but not in 3.5

There are very valid reasons to cap the framerate for mobile games. Battery consumption being the most important one. Why waste battery rendering games at 200fps when the game runs smoothly at 60fps? Also if the game is physics based there’s little reason to run it beyond the physics refresh rate.

In my experience setting the vsync on works on the 3 devices that we own (nexus 7, galaxy note and kindle fire hd) on the latest 3.5 unity so I assume it works on other android devices. Which 2 devices did you test it on?

I am testing on lg optimus 2x and on the xperia mini. The weird thing is that when i print the QualitySettings.vSyncCount value in a guitext it reports the correct setting but the fps is around 100 on the lg and 70 on the xperia. This happens only on the devices, on the editor the fps are limited… The only thing i can think of is that maybe is a pro only feature?

Tnx for trying to help guys

I have already tried that Hippo. Lets say i set Application.targetFrameRate=60.
i have a guitext to show the following:

d3.text = Application.targetFrameRate.ToString() + " " + QualitySettings.vSyncCount.ToString()

what i get on the editor
d3 shows 60 0 with vsync set to don’t sync, counter shows 60 fps
d3 shows 60 1 with vsync set to every vblank, counter shows 60 fps
d3 shows 60 2 with vsync set to every second vblank, counter shows 30 fps

what i get on the phone
d3 shows 60 0 with vsync set to don’t sync, counter shows unlimited fps
d3 shows 60 1 with vsync set to every vblank, counter shows unlimited fps
d3 shows 60 2 with vsync set to every second vblank, counter shows unlimited fps

So either i am missing something obvious or something is bugging…

I have an update for anyone interested…
I tested my app on bluestacks emulator and i got 60 fps with vsync on every vblank. This led me to believe that the problem is on my phones so i decided to uninstall everything unity related from my phones(i was working with unity 3.4 before and i had several apps installed on my phones).
After doing this i got capped framerate on my xperia (android 4.04) mini but i still get unlimited fps on my lg p990 (android 2.3.7):-). We are talking about the same build with vsync set on every vblank. I never had this problem with unity 3.4.
I guess this has to do with my project being imported from unity 3.4.2 to unity 3.5.7.

honestly i never cared about vsync count on mobiles - i would recommend to ignore this setting and set Application.targetFrameRate to whatever you need (30 as i understand)
as for not capping - we have seen several reports about that but they were fairly isolated.

You know that android do control the Vsync? If you turn that off, then your settings in the game do not work.
Also you only update the screen if something is changed.
So there is zero change in the screen if there is not any update in the code.
So the best cap you can do is use the real clock time, instead of use FPS.
Also make sure your script is working on the android phone. With the results you have I do not think that.
But in the end its up to you what you want to do, but I think it very strange to do this…