Search Unity

  1. If you have experience with import & exporting custom (.unitypackage) packages, please help complete a survey (open until May 15, 2024).
    Dismiss Notice
  2. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice

Wheels & Physics 2D - Joint setups and general questions...

Discussion in '2D' started by LaneFox, Aug 18, 2014.

  1. LaneFox

    LaneFox

    Joined:
    Jun 29, 2011
    Posts:
    7,557
    What is considered standard for wheel setups on vehicles? In trying to setup a Motorcycle it's starting to seem hard to contain my sanity. Am I just trying to set this up totally wrong?

    If I just add a wheel joint 2d to the body, connect it to the wheel, then the wheel just bounces everywhere.. left, right, up, down... There seems to be no way to tell it "Hey, this can only bounce up and down, like... like a wheel...".

    Why is it Spring Joint 2D allowed to spring past its anchor?
    Why does the Spring Joint 2D actually act like a hinge joint as well? There is an angle field, why doesn't it actually constrain to springing on that angle?
    Why does the hinge joint snap to its anchor instead of actually hinging at a distance? There seems to be no distance control on it unless you snap the anchor point to the connected anchor point?

    If anyone has an example setup for any kind of vehicle with wheels at all, please post it! I can't seem to find a single example of a wheeled vehicle with the 2D system.
     
  2. LaneFox

    LaneFox

    Joined:
    Jun 29, 2011
    Posts:
    7,557
    Here's an example of whats going on.

    The wheels are allowed to be pushed off of their spring angles and there doesn't seem to be any way to lock them onto an angle. I tried this with every type of joint and min/max frequency settings but still can't find a way to do it.
     

    Attached Files:

  3. LaneFox

    LaneFox

    Joined:
    Jun 29, 2011
    Posts:
    7,557
    Here's another example... This one is on a Slider Joint 2D.

    All of the joints will ignore their specified angle. Is this even intended behavior?

     
  4. LaneFox

    LaneFox

    Joined:
    Jun 29, 2011
    Posts:
    7,557
    Surely someone has made a vehicle setup with the 2D Physics system that has run into this?
     
  5. LaneFox

    LaneFox

    Joined:
    Jun 29, 2011
    Posts:
    7,557
    Seemed to fix this by taking the Position Iterations in the Physics 2D Project Settings from the default 3 on up to 100....