• 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
1
Question by NickP_2 · Nov 18, 2014 at 01:25 PM · laggymain thread

Main thread in editor gets really slow, but not on phone

I'm developing a mobile game, and I've never had this problem before.

As you can see in the image below, the main thread has a huge delay after firing the game for a few seconds.

alt text

When I run this on my smartphone, I have no issues dealing with FPS, it runs as smooth as a knife trough butter.

Too bad I can't use the profiler in the free version of unity, so anyone an idea what could cause this?

PC: 8GB RAM, i7, 2GB gforce 780 Phone: Acer S1, 1GB ram, Quad-core 1.5GHz

capture.png (177.1 kB)
Comment
Add comment · Show 2
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 Landern · Nov 18, 2014 at 01:30 PM 0
Share

Remember the engine is hosted in the IDE/Unity Editor. There can be any number of things slowing down your computer. If using windows, look at your task manager and try and ascertain if there are foreign processes consu$$anonymous$$g memory or cpu cycles. On a mac, you can use activity monitor to check running processes. Your phone is typically more isolated when it comes to processes and malware, peoples computers are littered with them.

avatar image NickP_2 · Nov 18, 2014 at 01:35 PM 0
Share

Hey Landern, thanks for answering

Yes this cause could be done by a million things, luckily I already found it... I'll be posting the answer for other people to check.

1 Reply

· Add your reply
  • Sort: 
avatar image
1
Best Answer

Answer by NickP_2 · Nov 18, 2014 at 01:39 PM

Apparently this is caused by the console doing too much work.

For me this line of code was the issue:

 animator.SetFloat("Speed", agent.speed);

But the animator didn't have a parameter named speed, so the console constantly printed this out as a warning, which took more process time whenever an extra zombie spawned.

I didn't know the console outprints could decrease your performance this bad!

Comment
Add comment · Show 1 · 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 NickP_2 · Nov 18, 2014 at 01:39 PM 0
Share

And because my mobile phone doesn't have to print this, the performance were smooth.

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.

Welcome to Unity Answers

If you’re new to Unity Answers, please check our User Guide to help you navigate through our website and refer to our FAQ for more information.

Before posting, make sure to check out our Knowledge Base for commonly asked Unity questions.

Check our Moderator Guidelines if you’re a new moderator and want to work together in an effort to improve Unity Answers and support our users.

Follow this Question

Answers Answers and Comments

27 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

Related Questions

Unity Frame Drop From Instantiating Prefab that has script 0 Answers

Camera.Render() & DockArea:OnGUI() seemingly random & unrelated errors after particles launch 0 Answers

Big Jerk or Lag when starting the game in Iphone caused by Shader.CreateGPUProgram, BatchRenderer.Flush and MeshSkinning.Render 0 Answers

Lag Spike in Profiller CPU Usage "Other" 0 Answers

Find can only be called from main thread, but fixing it variables no longer become global 1 Answer


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