terrains smaller than 20x20 create massive perfomance hits

Has anyone ever run into an issue where terrains smaller than 20x20 start to create massive hits in performance? And if so, is there some way to easily fix it?

I’m using the supplied platformer controller setup and this seems to be the source of the issue. If I turn off that script the framerate returns.

thanks!

ps- the reason for the tiny terrain is because it’s a tile for a randomly generated world

1 Answer

1

hehe. no, not hundreds. at any one time there’s a max of roughly 2-4 tiles visible. but I just solved my issue. It was the heightmap default setting (512 (or 513 as per unity)). I reduced it to 64 (65 as per unity) and it solved my issue. I figured it was a case of the system trying to calculate collision on incredibly tiny pixels and basically being unable to resolve. I can probably go even lower considering that the default terrain size of 2000x2000 uses the 513 heightmap.

I created the system the first time with planes instead of terrains, but the terrains come with other benefits that I really love and that were causing me headaches before.

Cool. I don't know if this was supposed to be a comment or an answer, but since it is an answer, why don't you go ahead and accept it since your problem is solved.

sorry about that, good point. I used the wrong comment button, but it works anyway. solved.