Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 14 Next capture
2021 2022 2023
2 captures
12 Jun 22 - 14 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
0
Question by Joana15 · Sep 21, 2015 at 09:34 AM · c#unity5vuforiaaugmented-realityframerate

How can I make android app run with less than 20 fps

I've been trying to make my game run with a specific frame, when I try to run on unity, it works exactly like I wanted, but when I put in my Android phone, the frame goes to 25 fps or more...

I tried to use Application.targetFrameRate, and I've already change AndroidUnityPlayer.cs

I'm using this code using UnityEngine; using System.Collections;

public class FPSScript : MonoBehaviour {

 public float updateInterval = 0.5F;
 private float lastInterval;
 private int frames = 0;
 private float fps;

 void Start() {
     lastInterval = Time.realtimeSinceStartup;
     frames = 0;
     
     Application.targetFrameRate = 12;
     
 }

 void OnGUI() {
     GUILayout.Label("" + fps.ToString("f2"));
 }

 void Update() {
     ++frames;
     float timeNow = Time.realtimeSinceStartup;
     if (timeNow > lastInterval + updateInterval) {
         fps = frames / (timeNow - lastInterval);
         frames = 0;
         lastInterval = timeNow;
     }
 }

}

Comment
Add comment · Show 4
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 Suddoha · Sep 21, 2015 at 09:50 PM 0
Share

What's the reason for targeting 12 fps? What are you trying to achieve?

avatar image Mako-Infused · Sep 21, 2015 at 09:54 PM 0
Share

The bad news is some devices have a forced vsync, this prevents apps from changing the FPS. No matter what you do the FPS cannot be changed on such devices, so it would really depend on which device specifically you're targeting?

avatar image Joana15 · Sep 22, 2015 at 01:26 PM 0
Share

Suddoha, this is a research! That's why I need every frame that I can catch the higher and the lowest..

avatar image Joana15 · Sep 22, 2015 at 01:29 PM 0
Share

I'm trying to run in android 4.1.2! I'm changing directly on Time.fixedDeltaTime; it seems to work now...

2 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by tng2903 · Sep 22, 2015 at 07:06 AM

You should separate between UI and logic, that way, you can have your logic run at whatever framerate you want, and the UI is update as fast as possible.

To update logic at a specified framerate, you could use InvokeRepeat, or custom made your own loop with do-while.

Hope this 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
avatar image
0

Answer by Joana15 · Sep 22, 2015 at 01:37 PM

I'm changing directly on Time.fixedDeltaTime; it seems to work now...

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

5 People are following this question.

avatar image avatar image avatar image avatar image avatar image

Related Questions

Cloud recognition in Vuforia 0 Answers

Close the VideoPlayer automatically after finished 0 Answers

Detect whether marker is present or not 1 Answer

how can I use the vuforia text recogniton with out using the sample package? 0 Answers

Unity AR - Measure speed using accelerometer while doing arm swing action 0 Answers


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