• 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 Pedro 2 · Jan 05, 2011 at 11:14 PM · lag

Too much lag in the game

Hey guys. I'm having a big problem with the game I'm creating. Whenever I run it on unity it lags everywhere. Fps drops to 9 and it becomes almost impossible to play. I tried to build it but the problem persists. I don't know where the problem is. However, I believe it is something to do with programming. I assume it isn't due to my computer since it is brandnew. I also have been using a lot of fbx files because I've been working on the design only.

I would be very glad if you could help me with some tips or anything else that could help.

thanks.

Comment
Add comment · Show 3
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 Whimsical · Jan 06, 2011 at 03:43 PM 0
Share

Please tell us some stats: Triangle and vertex count? How many Draw Calls does the engine have to make when it is that slow? How much VRA$$anonymous$$ is used and how much do you have available at all? Are you using shadows? How many (and if, what) post-effects? Using lots of physics with mesh-colliders? Also: Take a look at the profiler, it will tell you if the lag happens on the GPU or CPU side. If we have this kind of information it's a LOT easier to help you and we wouldn't have to guess randomly as we have to do now.

avatar image Pedro 2 · Jan 08, 2011 at 02:55 PM 0
Share

You're right. Here are some average stats:

draw calls: it varies from 1k to 20k tris:1.8$$anonymous$$ verts:9.9$$anonymous$$ used textures: 22 - 8.3 $$anonymous$$B Vram usage: 11.3 $$anonymous$$B to 141.8 $$anonymous$$B (of 1.00GB) VBO total: 15153 - 122 $$anonymous$$B

I'm not using lots of mesh-colliders.

That's all I can tell because I'm using de free edition which do not have the profiler feature.

After some researh I believe the problem is the draw calls. I think it is related to the quality of the models I'm using.

Hope it helps.

avatar image PrimeDerektive · Feb 07, 2011 at 09:31 PM 0
Share

That doesn't sound bad. Are you running any crazy resource intensive scripts? It could be a million different things.

5 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by Chris 4 · Apr 18, 2011 at 11:27 PM

What are your computer specs? If lag is really bad try making some items low poly such as background models. Or trees you never get close to in the game.

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 GameGuy · Feb 07, 2011 at 10:27 PM

Hi Pedro,

Different OnGUI functions are also a big performace killer, even when they are emty!

I had a Scene with 4 OnGUI functions, in a simple Prototype(nearly stats like yours). The framerate was not good, after removing 3 ONGUI functions the game was playable even on lowEnd Notebooks.

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 Pedro 2 · Feb 20, 2011 at 11:16 PM 0
Share

I haven't used any OnGUI functions so far. But I'll keep it in $$anonymous$$d while using them. I have been messing around with the textures and I managed to decrease a bit the drawcalls parameter.

avatar image
0

Answer by Pedro 2 · Jan 06, 2011 at 02:44 PM

Yes, that is true. I have a lot of trees, grass and some houses. Then, how can I solve it? I cannot remove any of these things...

I'll try what slkjdfv said, although I have never used that before.

Thanks both of you. I'll wait for more answers.

EDIT: I realised that occulision culling is an unity pro feature. However, I'm using the free version. So I'm afraid that is not an option for me ...

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 slkjdfv · Jan 05, 2011 at 11:58 PM

if you have lots of objects in your scene try using occulision culling, that might 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 3dDude · Jan 05, 2011 at 11:18 PM

Its probably something in your scene... Do you have lots of trees and grass? highPoly models?

All these things can contribute to framerate problems...

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.

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

No one has followed this question yet.

Related Questions

A node in a childnode? 1 Answer

How to make loading faster? 1 Answer

Unity Web Priority 1 Answer

Game Lags in Unity & after Build 4 Answers

foreach code causes lag spike C# 2 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