- Home /
Other
Load thousands of static colliders, or have hundreds of thousands at once?
In general, on a modern average PC, would loading in around a few thousand of static capsule colliders at a time cause a hiccup in the game, whether loaded by loadlevel.async or by resource folder? I know physx will sort of ignore far colliders but it might still be too much to have at once. Without loading them in there will be probably near 500,000 static colliders if not more. What have your experiences been with situations like this?
Answer by jmgek · Nov 02, 2016 at 11:43 PM
I don't fully understand what you mean by "Load thousands of static colliders, or have hundreds of thousands at once?" What are you asking? If you should load a thousand or a hundred thousand?
Either way this is not a very good practice to load in that many colliders, seeing how:
you're never going to hit more than 20 colliders at once
you never want to hit more than a few colliders at once because calculating collisions is expensive.
on each frame each collider is checking if it was hit. so do you really want to have 100 thousand colliders checking collision?
If you can give more information of what you're trying to do we can help more but as it is it's very confusing.
It does sound like you could benefit from a collider manager that sets a objects collider when it's within a distance of the player. similar to a chunk check: Sudocode:
if player in area: set all area colliders active
Yes. Because if not loading them in groups, they would ins$$anonymous$$d just all be sitting in the scene. Unity/physx ignores colliders that are too far from anything happening, from what I understand. But to what degree it can salvage performance I do not know.
Follow this Question
Related Questions
Tree colliders not working?!? 1 Answer
How do box collider collisions work mathematically? 1 Answer
How to create floating platform? 2 Answers
Fence with rigidbodies, explode? 0 Answers
Excluding some physics collisions 3 Answers