- Home /
Creating A Seesaw Lever
Hello! I'm looking to create a lever that moves in a seesaw like way. What I want is for the player to be able to grab one end of the lever (with a mouse click and drag) and pull down while the other side goes up. Essentially I want the lever to pivot up and down on the central point freely. I've seen some suggestions of Hinge Joints but that seems to be more for physics based interactions, like a real seesaw that goes up and down with weight. But then again I'm not super familiar with Hinge Joints. I want the player to control the up and down motion of the seesaw freely, and have a max and min range of motion that they can move their end around in.
the easiest way I could think of is to have the pivot of your seesaw where it should, well, pivot. then, when you click it for dragging, on click, save the vector from the seesaw tip (front center) to the cursor position in whatever space (world, viewport, screen). when moving the mouse, add the inverse of that vector to it and let the seesaw "look" at it with its tip.
Your answer
Follow this Question
Related Questions
Multiple Cars not working 1 Answer
Player Movement in unity3d 1 Answer
How to simulate 3d rotating gears with joint or constraints? 0 Answers
Rolling a 3D triangle 0 Answers