With the help of physics motor and slider I want to rotate and slide my model.
With the reference image I want to rotate my gear and a red cube I want to slide or move with direction in the image.
With the help of physics motor and slider I want to rotate and slide my model.
With the reference image I want to rotate my gear and a red cube I want to slide or move with direction in the image.
The main trick with many rigidbody constraints is getting the constraint's empty aligned the way you want. Though before aligning anything, me must first create something to align:
Now our the gear should rotate when we play the simulation:
Well, it did rotate, but it also fell down. To prevent that, we'll have to use a second constraint to actually attach it to the cylinder.
Add a second constraint by again following the steps above, but this time pick Hinge for the constraint type and rotate the hinge empty so that its local Z axis is aligned with the axis of rotation.
don't ask me why one is X and one is Z..
Once you get the correct empties oriented the right ways, your gear should now behave like this:
The process for a motorized slider is very similar, but this time you'll want a Motor constraint set to Linear Motor instead of Angular Motor, and a Slider constraint instead of a Hinge constraint. This time both constraint empties should have their local X axes aligned with the axis along which the cube should slide.
Once you have this set up, try enabling and adjusting the Lower Upper limits on the hinge constraint. These control how far the cube is allowed to slide (in blender units).
If you want the cube to slide back and forth (or do anything besides move in one direction at a constant rate), you can drive or animate the Target Velocity of the linear motor constraint: