Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 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 /
  • Help Room /
avatar image
0
Question by Tona999 · Mar 14, 2017 at 06:51 AM · androideditorfpslag

Game slows down when no input is given.

Hello, I am making a very simple game that always runs smoothly at about 58-60 fps on a Galaxy J5 (low-medium range phone) but it seems to be lagging on my LG G2 (medium-high range phone) ONLY WHEN I DO NOT GIVE IT ANY TOUCH INPUT. No method is called when I single tap the screen but as long as I keep tapping the game runs smoothly at 59-60 fps, but when I no longer tap(or swipe or hold) the game goes at 45-50 fps. The game runs always smoothly in the editor. Any ideas about this?

Comment
Add comment · Show 9
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 Nehrk · Mar 14, 2017 at 07:54 AM 0
Share

is there any Debug.Log("") present? How do you catch the input?

avatar image Tona999 · Mar 14, 2017 at 08:01 AM 0
Share

I have a separate script on the player that controls the phase of each touch and its coordinates and calls a method on the player. As I said no method on the player is called when I tap the screen but it removes the lag. Is Debug.Log() a problem?

avatar image Nehrk Tona999 · Mar 14, 2017 at 08:09 AM 0
Share

if you spam Debug.Log() messages on update this will easily crush app performance. Try to use Profiler and see where is problem(calls/self$$anonymous$$S);

avatar image Tona999 Nehrk · Mar 14, 2017 at 08:15 AM 0
Share

Well there is no Debug.Log() in any update so I don't think that's the problem. Could it be something related to synchronization (vsync) or target frame-rate? I have an Application.targetFrameRate = 60 in the start function.

Show more comments
avatar image Tona999 · Mar 14, 2017 at 04:16 PM 0
Share

@hexagonius I've been trying to do that all day long but the profiler just stops after a couple of frames and makes the game much much slower (10-15) fps. Deleting the Application.targetFrameRate=60 partially solved the problem but it's definitely still there.

avatar image hexagonius Tona999 · Mar 14, 2017 at 05:51 PM 0
Share

if the profiler cannot help you and the game gets unpredictably slow, cutting your content in half and seeing if that solves the problem, then adding up a quarter etc. could be a solution.

avatar image Tona999 · Mar 14, 2017 at 05:57 PM 0
Share

Nope it doesn't solve it. As I said the game runs very good on a low-end phone but still struggles on my LG. I can still play games like GTA or Formula1 on itso I don't think it's a phone performance problem...

avatar image hexagonius Tona999 · Mar 21, 2017 at 05:00 PM 0
Share

I referred to code reduction if that's possible. disabling gameobjects etc. ruining less code, or maybe nothing at all to see if it's graphics hitting you.

0 Replies

· Add your reply
  • Sort: 

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

176 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

What is editor overhead ? [2017.3] 4 Answers

Why does my Scene View use 100% processor 0 Answers

Prefabs in limbo causing HUGE lag 1 Answer

near/far Soft Particles work in editor but not in android 0 Answers

Gfx.WaitForPresent rant, and editor fix 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