Physics Wont simulate

Hello everyone, I am making a hole game in which if you move the hole underneath the objects, the objects will fall through the hole.

You can control the hole using WASD, I am using stencil buffer to create the hole and I have a trigger collider on the hole, when it touches the cubes, it changes the collision group of the touching cube and it will fall through the surface due to gravity, the one issue I am facing is that if a cube is above another cube, and if the the cube which is below touches the hole it will fall through but the cube which was above will be stuck there (physics gravity wont apply to it).

Link to game : https://playcanv.as/b/F5LdhY8H/

Any help would be really appreciated!

Is the trigger for the hole big enough to cover the cube that is on top of the one that falls through?

No it is not,
Capture
It has been intentionally made like this because if I make its height bigger, the top cube will fall just like the bottom cube hence giving no effect of falling though(very static feel), like if I have a pyramid made of cubes, and my trigger height is large, the cubes will fall through them but the effect wont be nice as the cubes will fall with the same speed, so basically I just want the bottom cubes to fall through and allow the top cubes to automatically fall through the hole (which will give better effect).

@yaustar Why does the physics engine think that their is a cube underneath it? even though it isnt?

Not at a computer to look at it at the moment. Is it set to static/kinematic? Does it work if it’s not on top of the other cube?

Its set to dynamic (all cubes are), the bottom cubes fall through the hole while the top cube stays at its place even though they are same (dynamic).

Can you supply a link to the project please? If I get some time, that will allow me to fork and play around with it a little bit.

Just to test a theory that they may be asleep and for whatever reason, not waking up correctly, can you call activate on every rigid body on every frame please?

1 Like

Yes @yaustar you are right, if I call activate on every rigidbody on every frame, it works. Thanks for the workaround, but doesnt this increase CPU cost? or it wont?

If so, I wonder if you could call the activate only when any other cube moves? Though it may be that monitoring the movement of all cubes is more costly.

1 Like

It can do as physics objects ‘sleep’ until the region it’s in is changed as an optimisation.

I’m not sure why it is still asleep after the cube below it is moved by gravity. That really confused me and wonder if it’s a bug.

I would experiment a bit by applying a tiny, tiny force on the cube at the bottom when it enters the hole trigger.

1 Like