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);
}