- Home /
how do i disable a mesh
so I'm trying to use chunks to disable meshes to decrease fps lag, so i decided i should either somehow disable the mesh to make it invisible or i should use something to block its sight but i don't know how to disable a mesh inside of a script is it possible or not if its possible please tell me how.
Answer by tdx110 · Mar 17, 2021 at 09:15 PM
Probably you use MeshCollider?
GameObject go; //This is Your GameObject with meshCollider
go.GetComponent<MeshCollider>().enabled = false;
Answer by KingKatGamer · Mar 18, 2021 at 12:33 PM
ok that would make sense but if i think of it a mesh collider adds collision based on the mesh shape so if i had a capsule but i changed the mesh shape to a cube it would still have the same collisions untill i use a mesh collider?
but know that i think of it now i can just disable the whole mesh by using the mesh renderer
exactly. And You can disable Collider, or GameObject
Your answer
![](https://koobas.hobune.stream/wayback/20220613030848im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
aim script error 1 Answer
Sudden framerate drops? 4 Answers
60FPS but the game seems lagging 2 Answers
How to make lag free terrains 1 Answer
Unity Trees Destroy Performance 0 Answers