Kinematic Dynamic objects interaction

Hi Defolders,

I’m practicing with Defold physics, but there is something I don’t fully understand.

I have two dynamic objects resting on top of a kinematic platform that moves on x. Both objects collide with each other so the kinematic platform stops the dynamic object from falling down. So far what I expected, but when the kinematic platform moves the dynamic objects that rest on top of it don’t move along, why is that? I was expecting that the platform carries along the dynamic objects.

I attach a pic of the situation with the physics debug enabled.

Can anyone explain to me what’s going on? How can I make the kinematic platform carry the dynamic objects?

Thanks :slight_smile:

Does setting full friction on both objects make any difference?

Hi britzl, thanks for replying.

I have set friction to 1 on all the objects with the same results. I also increased the gravity as far as -10000, but it didn’t affect the result.

I noticed that when a dynamic object is on top of another dynamic object and the object below moves it does carry the object on top. It just doesn’t seem to work this way with kinematic objects carrying dynamic objects.

Any other thing that may be causing this?

Ah, yeah, it could be that a kinematic object won’t interact with a dynamic one…

That’s seems to be the case :sweat_smile:

Is there any work around for this particular situation?

How could I make moving platforms that carry dynamic objects?

Thanks a lot!

Hmm, not sure. Is it out of the question to have all objects dynamic?

I’m toying with a physics puzzle where player has to destroy or move objects to make a square reach x position. Most objects in the game respond to physics and gravity but I wanted to put as well some flying platforms and some objects player can drag on an axis to make things more interesting.

Is there a way to make a dynamic object to ignore gravity in order to make it a flying platform?

Thanks again for you help britzl. I’m still new in Defold.

You could have both kinemtic+dynamic collisions objects on the gameobject in question and disable/enable them as needed. With a kinematic you take control of setting position, applying gravity etc. but you still get collision messages.

For example, when colliding with a platform you can disable the dynamic object, enable the kinematic and parent it to the platform and so on.

1 Like

Thanks Johan, it totally makes sense. I’ll give it a go :grinning:

Cheers!

2 Likes