Collisions Inside A Primitive

I am working on a game where I want to have objects floating around inside a space. Each object has a random motion but should stay inside an invisible cube.

Is there a way to use a cube primitive that calculates collider information based on the inside of an object?

My tests so far have not shown the cube acting as a container.

If you’re asking how to “invert” a primitive, I don’t think you can; use a meshcollider with inverted normals, or put 6 flat cubes on the sides.

Putting the six cubes around the sides will work infinitely better if it is a large world. I recommend that method

Thanks. I seems to be working well.