Force 60 FPS on Unity

I can’t achieve 60 FPS in a Unity Build on my Android device.

What I tried:

  • QualitySettings.vSyncCount = 0;
  • Application.targetFrameRate = 60;
  • Set Project
    Settings/Quality/VSyncCount to Don’t
    Sync
  • Remove everything from the scene,
    there’s only a camera and still
    locked 30 fps

Note: I achieved 60 FPS on this device before, so I don’t see what’s wrong now

EDIT: This code looks laggy/ugly at 30 fps. It moves a sprite from a position, to an other.

public IEnumerator MovePieceRoutine(Vector2 from, Vector2 to, Transform piece, Vector2 targetPiecePos)
{
piece.parent = camera.transform;
float timePassed = 0;
Vector2 originalPiecePos = piece.localPosition;

	while (timePassed < MovePieceAnimTime)
	{
		float t = timePassed / MovePieceAnimTime;

		Vector3 currentPosition = Vector2.Lerp(from, to, t);
		currentPosition.z = CameraZ;
		transform.position = currentPosition;

		Vector3 currentOffset = Vector3.Lerp(originalPiecePos, targetPiecePos, t);
		currentOffset.z = piece.localPosition.z;
		piece.localPosition = currentOffset;

		timePassed += Time.deltaTime;
		yield return null;
	}

	transform.position = new Vector3(to.x, to.y, CameraZ);
	piece.localPosition = new Vector3(targetPiecePos.x, targetPiecePos.y, piece.localPosition.z);
}

Actually you don’t wan’t your game to run at 60 FPS on android. Android is a system that manage itself so it will limit your framerates to avoid using too much battery. Nothing in unity can changes this its in android.

If your game need to run at 60 fps to be smooth its a problem :confused:
Verify thats your using FixedUpdate in deplacements and physics.

Raph