bullet solver dynamiic actor pass through actor 2

hello.i am having a problem in bullet solver. I have created a box using rectangle sops and i use it as a static actor.i have linked it’s position to my mouse so i can move it. Inside it i have a dynamic actor(a simple sphere sop). The problem is that when iam moving my mouse and therefore my container box the sphere pass through the container. Any help in solving it.?

From the sounds of it, the problem is that you’re changing the position of the actor rather than its velocity, so the body will essentially be teleporting through space (and have no inertia) as far as the simulation is concerned.

I do understand why you would do it this way, since you don’t want the controlled actor to be affected by outside forces like those from collisions or gravity, but unfortunately you won’t achieve a realistic outcome with this approach.

To solve this issue, you’ll need to make the actor controlled by your mouse dynamic as well. You can toggle off global gravity so it’s not falling off screen. You’ll also want to make its mass very large relative to the ball so that it is not moved around by collisions with the contained ball.

Then, you will want to control this dynamic box’s velocity not its position. This can be done by setting the linear velocity to be some magnitude along the direction vector between the box’s current position, and your mouse position, depending on how fast you want it to reach the mouse position. You could do this using the Linear Velocity parameter of the Actor COMP (because it’s just one body), but a better method is to use feedbacking via the Bullet Solver CHOP to override velocity. There’s a Bullet Solver COMP snippet called 2D attraction that showcases this workflow.