- Home /
Object falling through floor
I have a rigidbody object built via probuilder in Unity that once I move it via transform while on the ground it will eventually slip through the ground. I have a box collider on it and all the proper mesh components on it as well. The ground is a large 3d cube with all the mesh components and box collider. If you need anymore info let me know.
Thanks
Are any of the box colliders trigger? And if not, may I see the rigidBody configuration?
Yeah so none of the box colliders are triggers. Here is the rigidbody config.
Answer by AShenawy · Aug 01, 2018 at 07:12 PM
In the object's Rigidbody component try switching Collision Detection to Continuous.
It's even worse when I do that. Really don't understand why it is doing this. Do you think it has something to do with the fact I'm using a probuilder object?
It's possible but I can't be sure as I haven't tried probuilder objects yet. Could you try the same thing with a simpler geometry like a cube and see if it still happens? if it does then we know it's not a probuilder issue.
I took off my own gravity I made in the scripts and used the rigidbody one. It does solve the problem of it falling through the floor but I am having other issues with collision detection like going through walls at relative high speeds even when using continuous detection. I think I'll try using the rigidbody methods to move it rather than transform and see if that helps anything
If you want to apply gravity on your objects I thinks it's better to use the Gravity parameter in the rigid body component ins$$anonymous$$d of applying your own, as it should be more in sync with the physics simulation.
As for high speed collisions, I have made bullets that bounce off walls using the continuous detection method on the bullets and worked fine. Perhaps you're moving things way too fast than needed? In any case you could move down the list to Continuous Dynamic, or set both objects colliding to Continuous and see how it goes.
For me when collisions aren't registering it's usually because my objects are moving too fast, even for a player to notice. So most cases I would reconsider whether I even need to detect collisions if things will move this fast.
EDIT: forgot to mention, you can also script your motion controls and behaviour in the FixedUpdate method ins$$anonymous$$d of Update. FixedUpdate is the one where all physics simulations take place.
Answer by ThePhantomGoat · Aug 01, 2018 at 06:29 PM
make sure that a ridgid body is attatched to the object and that it is dynamic, then raise it a little off of the ground and play (this worked for me)
Dynamic rigid bodies are in Physics2D only. 3D physics objects don't have a Dynamic option.