So… To get the collisions I want. I need to make every wall, ceiling, floor… A rigidbody.
Is this a bad idea to do? Will it take up too many system resources?
So… To get the collisions I want. I need to make every wall, ceiling, floor… A rigidbody.
Is this a bad idea to do? Will it take up too many system resources?
It sounds excessive. What makes you think it’s necessary?
What are “the collisions you want”? It does indeed sound excessive, and I can’t think of a use case where you would actually need to do what you’re describing.
I need to be able to check if objects of various sizes and shapes will fit into a given space. Before an object is placed there.
How will making everything a Rigidbody help with that?
Note that the Physics class has methods for doing exactly what you describe for spheres and capsules.
objects I’m placing are a little more complicated than spheres or capsule.
Spherecast, bounds.intersects aren’t very good. Sweeptest is better but doesn’t work the way I need it to work. (as it is about a direction rather position)
I guess I could try a ontrigger… But even all objects I place will still have to be rigidbodies. Unless there is a way to make an object a rigidbody in game?
I’m still not clear on why you need these things to be rigidbodies. Colliders, yes, but they only need rigidbodies if they’re going to move.
It is the only way collisions can be detected. Something has to have a rigidbody in order to know if a collision occurs. The user choose where to place objects, whether it is on the ceiling wall or floor. However some places or positions won’t work because the object might end up being partially inside the wall, floor, or ceiling. So collisions would tell the user if the object could actually be placed in that area. It would be like the Team Fortress 2 turret, except with chairs, vases, and trees instead of a turret.
Perhaps placed objects don’t need to be all rigidbodies if there is just a single rigidbody that is used that had a collider shape that could be changed rather specifically to fit the dimensions of the object that is going to be placed. I’m not keen on the pill or sphere shape just because there are objects that are very boxy but also other objects that would work fine with a pill or sphere shape.
Is it possible to change the collider of an object to some other piece of geometry? Or modify the geometry the shape of the geometry in terms of the placement of the vertex. Cause if, a general blobby tessellated object could be used to wrap around the object to be placed to get a rough approximation of the objects dimensions.
Ah I see. OK, yeah, you could have a ‘space-tester’ object with a rigidbody that you attempt to move into the desired place. All the objects you’ve actually placed can just be static colliders, without rigidbodies.
Sure - just change the sharedMesh.