Search Unity

How to make automatic swing (Hinge joint 2D?)

Discussion in 'Physics' started by MitjaHD, Nov 6, 2018.

  1. MitjaHD

    MitjaHD

    Joined:
    Sep 30, 2018
    Posts:
    45
    I'm trying to make a simple automatic swing that swings to left and right without losing speed. I am able to create object that rotates full 360 degrees using hingejoint2d and using it's motor, but I don't know how I would create a swing (I tried playing with angle limits but with no luck). The closest I was is to use motor and then disable it, which causes the object to swing from one side to other, but it loses speed over time.
     
  2. Antypodish

    Antypodish

    Joined:
    Apr 29, 2014
    Posts:
    3,825
    Reduce / remove drag of rigid body.