Creating Gear Joints

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
Connorses
Prole
Posts: 49
Joined: Fri Sep 06, 2013 7:02 am

Creating Gear Joints

Post by Connorses » Thu Jun 15, 2017 4:49 am

I'm trying to use the Gear Joint, and I've got 2 bodies attached to a static body via Prismatic Joints. The prismatic joints work fine; adding the gear joint causes both bodies to lock in place. I noticed that the Gear Joint page says "the joints it uses connect their respective bodies to the ground and have the ground as the first body". I think this is my problem. What does "the ground" mean and how do I attach things to it?

User avatar
raidho36
Party member
Posts: 1833
Joined: Mon Jun 17, 2013 12:00 pm

Re: Creating Gear Joints

Post by raidho36 » Thu Jun 15, 2017 6:45 am

It means that gear-connected bodies cannot float freely, they must be connected to the ground by the joints you lock together by gears, and those joints must lock ground to body, not body to ground - function argument order matters too.

Connorses
Prole
Posts: 49
Joined: Fri Sep 06, 2013 7:02 am

Re: Creating Gear Joints

Post by Connorses » Fri Jun 16, 2017 2:20 am

Hey, so I figured it out just now! I had to set the ratio to a negative number. The prismatics locked in place because they were both trying to move past their limit.

Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 12 guests