Hi, I'm new to Love2d, and I was trying to make a mechanic with a PulleyJoint and two rectangles that were restricted to move only along a y axis and not rotate. However, when I tested this, it completely broke. Even though one rectangle was twice as heavy, they wouldn't move. Am I understanding/implementing something wrong? I isolated the blocks and pulley and the same thing happens (attached). The actual project I'm using this for involves a system of resizing the counterweight block (and increasing its mass proportionally) under similar conditions, which will make the main block move slightly but only because the anchor point on the counterweight block changes. It eventually just inches back to equilibrium (the original positions), despite one block weighing almost 1000 times more than the other.
I can't attach the actual project because when I tried to make it into a .love file and running it, it returned errors about files. For some reason it runs just fine when unpacked with notepad++ and command line but can't find the files when it gets packaged into a love file.
Thank you in advance for your help!
Questions about PulleyJoint
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
Questions about PulleyJoint
- Attachments
-
- pulleyJointTest.love
- (1.35 KiB) Downloaded 120 times
Re: Questions about PulleyJoint
In the example you've posted, one of the anchor points is wrong. This creates the pulley joint correctly:LEVR wrote: ↑Tue Jul 28, 2020 10:03 pm Hi, I'm new to Love2d, and I was trying to make a mechanic with a PulleyJoint and two rectangles that were restricted to move only along a y axis and not rotate. However, when I tested this, it completely broke. Even though one rectangle was twice as heavy, they wouldn't move. Am I understanding/implementing something wrong?
Code: Select all
pulleyTest.pulley = love.physics.newPulleyJoint(pulleyTest.mainBody,pulleyTest.cw,0,-200,200,-200,0,0,200,0)
Zip files are case-sensitive. Be careful to respect the case of all files in the code. That will also happen to Linux and BSD users.LEVR wrote: ↑Tue Jul 28, 2020 10:03 pm I can't attach the actual project because when I tried to make it into a .love file and running it, it returned errors about files. For some reason it runs just fine when unpacked with notepad++ and command line but can't find the files when it gets packaged into a love file.
Re: Questions about PulleyJoint
I see. I managed to get the correct result with your fixes as well, thank you very much! I'm guessing that all joints use world coordinates for anchors then? It didn't mention world or local on the wiki so I assumed local. Also, does the prismatic joint only allow movement in the direction of the axis vector and not the opposite direction? If so, is there any other joint that will allow movement in either direction on an axis?
Re: Questions about PulleyJoint
Yes.
I don't know, I assumed it would allow movement in both. I'm still puzzled about it.
Who is online
Users browsing this forum: Google [Bot] and 3 guests