- Home /
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.
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
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.
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.
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!
And because my mobile phone doesn't have to print this, the performance were smooth.
Your answer
