- Home /
Click and drag object, apply force to other objects
I'm working on a project where the user can click on an object to move it with the mouse, for it to collide with and "push" other objects (Think Air Hockey, where you can click and drag a mallet/paddle and use it to hit pucks), and would like to know the best way to go about doing this. I've seen a DragObject.cs script often referred to for questions like this, but it appears to work by only changing the object's position, which would result in any objects it collides with not being moved by the object being dragged. Thanks in advance for reading this.
Answer by DaveA · Aug 23, 2012 at 10:37 PM
Did you try that script? Looks like it should do what you want I think. http://wiki.unity3d.com/index.php/DragObject. Note this: http://docs.unity3d.com/Documentation/ScriptReference/Rigidbody.MovePosition.html
I used that script, but the stationary objects it collides with are unmoved.
$$anonymous$$aybe obvious, but the stationary objects, they have RigidBody components on them?
Yes sir, the stationary objects do have RigidBody components on them.
Your answer
Follow this Question
Related Questions
How do I move this rigidbody? 1 Answer
Why thrust direction o f the ship don't change? 1 Answer
How can I make a physics object jump a given height on collision regardless of current velocity? 1 Answer
Player movement ignores some collision 0 Answers
New Input System 'Started' and 'Performed' actions fire at the same time? 1 Answer