why would my low poly weapon lower my fps by over 100?

hi guys, i created a weapon and put it into my scene for testing, but it seems to kill my fps dramatically, its only 110 tris with a 15kb texture, i do not understand? could somone please explain. thanks :smile:

perhaps its your script?

without the weapon in the scene i have 200+ fps?

sure its the weapon and not the UI?

yes, without the weapon and the UI open i have 200+ fps

Do you have any scripts attached to the weapon? If so, what are they doing?

i have, both one to rotate the weapon slowly and one for the weapon properties however after disabaling both the fps does not increase :frowning:

no I mean really the ui aka the inventory there

no, look without the weapon there i have 150 fps and it varies from 140-200

there are more differences between the screens than just that.

so any of them might be it and out of experience I’m willing to bet that it is not the model of the sword (not even on an intel CPU to DVI adapter, also called intel gpu, you would get such a drop, not even if it was 40k poly ^^), but some code that is running in a loop suboptimal or totally suboptimal UI code (ongui is called multiple times per frame so don’t have loops in there and don’t process input in there etc)

but i dont understand why it only drops when the weapon is in the scene… even with the script enabled or disabled…

Can I see a wireframe of the model?

Did you test if it also drops the fps if your inventory script is disabled

What system are you running? It’s not going to help you, I’m just being nosy. :slight_smile:

Sometimes I have noticed that a script that is unticked runs anyway. Correct me if I am wrong however it has happened.

Try removing the script from the object, it does sound as if some sort of loop on the object(the slow rotation for instance) is causing the slowness. Can you post that code?

heres the requested wireframe:

also upon exporting as 2010 FBX, i deleted all history, removed animation, lighting.

Are you accessing components through ā€œgetComponentā€ functon?. Your getComponent calls, where are them?

It is strange; 54k of tris?.. isn’t too much guys?

theres 120 tris, not even 1k :stuck_out_tongue:

and no the sword currently has no scripts at all, or colliders, just the texture. The texture is 1024x1024, but only 15kb im not sure that the fact its 1024 matters?

Use the Profiler (Window->Profiler). With DeepProfiling you can easily see whether a script is the culprit, and even the line of code that is the most expensive.

EDIT: Oh, that’s a Pro feature :o) but an extremely useful one.