Problems with joints (solved :P)

TL;DR: just use previously defined sprite points for anchor locations

I’m trying to weld together several sprites together to make a miniboss with a more complex hitbox and detachable pieces, but either I misunderstood something or there’s something weird going on. I’m trying to set up a “test scene” to figure out how to make a game puppet out of several pieces and joints, and it’s wacky af.

Problems with weld joints:

In my sprites I have set up temporary “pin dots” and “holes” to figure out exactly where I want to fix them, the sprite that shows on top has the hole and through it you can see the color pixel of the sprite below so you can be sure it’s properly aligned

Problem: The coordinates of these pixels don’t give the expected results when used as anchors in the first object object, the two sprites become welded but completely misaligned. Fiddling with the numbers I have managed to align them, and the weld now seems magically much more solid ??? The “pin” coordinates I had planned for the 1st object are 43, 11 ; but the magic numbers are 49, 9 for some mystical reason. The coordinates for the anchor on the second object seem to work properly.

Problems with revolute joints:

Again I did the same with the pin dots (in a different color).

Problem: Same but way worse. The revolute joint seems to be working - the second body is rotating, around where exactly is anybody’s guess, but on creating the joint, the second body is again mystically teleported away from the first body… it seems to be rotating around an empty point WELL to the left of the first body; and the second body is also SEVERAL times its length away from the empty point (which moves together with the first body, which is something I guess). I have set the X and Y values for both anchors to 1, and the joint is NOWHERE within the dimensions of either 1st or 2nd body, the joint point is certainly not overlapping either of the points defined by coordinates in the “create joint” action, I expected them to be joined by the top left corners of their sprite bounding boxes, the 2nd hanging off the fist.

General problems:

I don’t see how you can pin any particular instance of an object, or pin them without first placing them carefully, since some joints seem to “snap” objects together and others don’t; I hope that since what I want to do right now is a multi-piece boss, I can get away with an externally defined layout and immediately pinning every piece in place (and all the pieces are unique)

If anybody can shed some light on these issues it would be much appreciated, for additional detail I guess I should say that the pieces are pretty small (from 4 to 64 pixels in dimensions) and the physics scale I’m using is 32

Actually my lightbulb lit up and I thought of using points, which works.

2 Likes

I need some help for like a making my caracter let go of a bike and with one button he ejects how can i do that ?

Assuming the character+bike are already set up, you’d have to delete the joints between character and bike.

ill try that alright this place is so helpful