Good Performance Ball Pit

Hey, I’m trying to make a huge ballpit for my game something to this effect https://gyazo.com/66d19c9f5f3f2fbb82d8e4b1a65b7bfd

Anyways, my question is how would I go about doing this in a way that wouldn’t affect server performance? I’m guessing having like 1000 small ball parts is a really bad way of doing that lol, preferably I want them to be collidable, and I need a ton I just have no idea how to make this work without lagging the game like crazy, thanks!

1 Like

What type of game is it for? Is this like a play ground game?

It likely will lag the server a bit. I recommend using some low-poly spheres with few subdivisions.

Turn off the CanTouch and CanQuery properties, leave CanCollide on.
This may help with taking out some of the background calculations that the balls don’t need.

I don’t think you can turn off canQuery without turning off canCollide.

No it’s for a fairly intensive horror game

But even if I do, if I have thousands of parts like that it will likely lag a ton there has to be some other way

maybe I can just load the balls on the client and that would take some stress off the server if I just instanced the balls in on the client?

Create the balls on each client. This will give you a whole lot more freedom in terms of lag management. A phone cannot (in my experience) handle 1000 unanchored parts without suffering a little, but a computer should be fine. You can use UserInputService.TouchEnabled to know who’s on mobile and who isn’t, and from there you can get an idea of how many balls to create, etc.

On the bright side, as long as your game isn’t super demanding already (and the client has a powerful device), you can probably get away with creating 1000 unanchored ball parts without having to do too much.

1 Like

everything those previous posts said like client rendering and stuffz
but also create a radius for the balls and stuff where balls completely out of sight could just not be parented to the workspace or transparency set to 1
also yeah anchoring and disabling collisions would also be cool

1 Like

To my knowledge, I don’t believe there is any way to have 1000 moving parts without the game lagging. If only games had the power of real life.

1 Like

does the ball pit have to be functional? if not just make the top part of the balls (like a lid)

1 Like

It looks really good. I Might be able to help does it need to be functional?