- Home /
Mesh causing frame-rate issue
Hey Unity3D gods. I'm having a very frustrating problem with a game I'm working on.
I built an early level for an RPG, and I have a section of floor in the "mine" area of the tunnel. Whenever my character has entered the collider on this mesh, it cuts the frame-rate in half! I ended up redoing the mesh, and I still have the same problem.
The mesh is separated into 3 parts. The walkable path area has 28 polys and uses a mesh collider. The other cliff sections have no collision at all. I know what you are thinking too...the rocks, mushrooms, mine support, and other props are causing the FR issue. But that is NOT the case! The mesh was causing this problem before the props were added.
I added a screen capture video for you guys to help get you a better idea. The game is NOT as laggy as the video shows. The lag was from the video capture software. Watch the frame-rate counter in the Statistics though.
Video: Here's the video. Thanks!
Howdy, Just to be clear, the character is a "character controller" with the typical capsule collider? (Also: just a wild random thought, the problem is not caused by the many lights in the scene?) To be clear, if you simply disable the 28-poly mesh (put in a simple flat cube as a temporary floor) --- does that completely solve the problem? Cheers..
Yep, it's a regular character controller. I temporarily deleted the mesh, and it runs fine. $$anonymous$$aybe the size of the mesh is too big (it's scaled pretty large) and is causing some weird unity bug. Thanks!
$$anonymous$$aybe it is some weird scaling thing. Scaling often causes woes in unity, it's better to make the models actual size in $$anonymous$$aya. I wonder what would happen if you simply set the scale of that mesh to 1,1,1 Of course it would look silly sitting there tiny, but, does it then run normally? Cheers
Answer by ScottKnowsnow · Jan 20, 2012 at 09:26 AM
Its not any of those! It's because of your model itself. it has over 22k vertices! Thats a lot! You need to sacrifice the quality of your model and ensure it is a much lower vert count. Also maybe you have too many particles as well. as too many particles slows things down too. Also you may have too many textures on the character, try just making a really good colour map for it. Hope it helps!
Hi Scott -- hmm, I have been able to use 20k++ vertex models no problem. You could certainly be correct, but I'm just saying. ($$anonymous$$aybe the problem is he has such a high-count model in a small area? I don't know.)
You raise an excellent point: he should TRY IT WITH A S$$anonymous$$ALLER $$anonymous$$O$$anonymous$$. That would resolve the issue. Good one.
@Fattie I'm just talkin from previous experience, the less verts the better in terms of performance, also when it comes to UV maps ensure there are as few hard seams as possible. And reduce the number of texture maps, I usually try to make a good colour diffuse map as although normal maps etc look pretty, thats extra processing work for the computer