- Home /
How can my mouse-controlled object interact with Rigidbodies?
So, imagine there's a bunch of gravity-obeying rigidbody cubes sitting around on a table.
I want a 'pusher' (box collider) to be controlled by simple mouse X/Y movement (as if it was a mouse cursor), only on the X and Z axis. That is no problem.
However, I want my pusher to be able to push the rigid bodies, apply force to them. This seems to be a problem.
I can kind of nudge them when my pusher interacts with the boxes, but by and large it just pushes right through them. Sometimes the boxes fly up into the air, sometimes they fly the wrong way, etc.
I've tried tinkering with settings of the Rigidbody on the Pusher, but I can't seem to get it to interact properly unless I control its movements entirely with applyForce. ApplyForce does not make for the smooth kind of mouse movements I want. Is there a way to do this?
Your answer
![](https://koobas.hobune.stream/wayback/20220613153548im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
How should I control a 'rake' that pushes objects around a table? 2 Answers
Shake Effect 0 Answers
How to move while jumping? 1 Answer
Softbodies in Unity 3D 1 Answer
Player mouse rotation 2 Answers