Center points and physics joints

Greetings,
Im building my first ragdoll and when i move the center point it all goes bonkers.
I am moving the center point from the middle of the object to the location where it has the physics joint. So that i can rotate the object with tweens etc when its not ragdolling.

This is how its supposed to work:

This is after moving the center points:

Anyone had this experience? I would love to understand why its doing this so i could make a workaround.

Best regards

I’ve never made a rag doll but I have made joints. What are you using for the joint positions? I usually create custom points on the objects. This is for a chain using a 2 object revelout joint.

My original joint was off the first time because when I copied the X field, I forgot to change the X() to a Y(). So, it used X() for both joint locations.

1 Like

Yes i use points. Its the only way i know. I added points for every joint and that works fine, but if i try to move the center point from the center it all breaks.

Yes, I see what you mean. I changed my points to random locations and it broke my chain.

IDK. I’ll do some playing around. Maybe it’s a bug or there’s a method to the madness.

Maybe you need a different style joint. Or turn the angle limits on and set the min and max to the same value.

This works although IDK if it fits your needs.
I used a button to start the tween.

1 Like

This is my first ragdoll and the first time i use joints. So i tried all the joints. :joy: I use the angle limits for kinematics sadly, so that wont work for me.
If we could tween the angle around any point of an object, then this problem wouldnt exist for me. But i dont know how, if so.
I will keep battling this problem, if youre doing something similar i can post any progress here.

I experienced a similar problem when i made aircrafts controlled with physics, without joints. But what i can remember the origin point was involved too then. So i think the problem is related to the physics and not just the joints anyway.

Just so I’m clear. When the physics is disabled, you want to move it with tweens? Are you talking about the ragdoll as a whole or each joint?

After some time with the chat bots. I came up with this. I used a pivot object for the test location and object points named “Left” and “Right”

Try me: move the slider and click Left or Right. The puple X is draggable and moves the sprite.
https://gd.games/instant-builds/4b0fdd67-b4c3-40f9-a69f-c029dde62e12

project: (click green [code] and [download zip]
https://github.com/doug13579/gdevelop-rotate-an-object-based-on-a-pivot-point

I don’t believe this is needed. I tried a different concept before this.

Thats awesome, looks like it works! Not sure how yet. :sweat_smile: Im gonna try something like this. But im taking an involuntary vacation from gdevelp for a while since i seem to have overclicked my arm, again. So this will be examined in a planning phase.

The plan is to use tweens on every part of the skeleton. Like i have done with my knight, except the legs that are pre-animated. Doing a walk cycle with tweens with code could be slightly hellish though, so not sure i will do the whole thing. The physics will probably be disabled while the tweens are active, at least the gravity.

1 Like

To rotate all of the joints using this method might be tough unless maybe you created a function. Functions would definitely make it easier.

It might be easier to use 2 sets of objects and swap them. Or maybe use the limits approach that I mentioned earlier. I know you said you already used the limits but maybe you can switch the numbers based on a mode.

Have a good rest. I do the same with my wrists.

1 Like

Swap hands for your mouse. I’ve had to do that because of pains that occurred with my dominant hand/arm. It’s a bit weird at first, and you feel quite uncoordinated to start, but your fine motor skills do improve.

1 Like

Im planning on buying a Kensington slimblade pro trackball and maybe something else. The more the merrier, coz variation. And your suggestion is a great idea and at a very good price. :smirk: I will try it, it will take som time to adjust to a trackball too anyway.

I’ve tried different controls but for me they didn’t have the same amount of accuracy. Taking a break helps. I’ve also used a wrist brace that forces your hand into a better angle. That helps.

1 Like

I used a trackball when i was younger so im thinking i want to try it. I built a brace that i usually use and chew anti inflammatory pills. My vacations are usually not long. And its good to have some downtime and sketch, plan and write etc i think, but i would much rather choose when. :laughing:

1 Like

Just reporting in here and passing on how i solved this for my game. Where enemies move with coded tweens and die with physics.
As the centre point is a very important point to that lil phys-engine i decided to follow its demands. So i prepared all my skull and bone objects for physics that i will use and made them work satisfactory.
The problem we had was that tweens really want that centre point too. And when getting both physics and tweens to work its very rare points are in the same place. And they refuse to share the point obviously. So i moved the other point that is connected to the centre point to far off the boundaries. Its not pretty to look under the hood, but now my skeletons can walk around proudly with their skulls held high and we can chop them off gleefully by just disconnecting the physics joins.
:kissing_smiling_eyes:

2 Likes