Collision object behaviour

Moving the parent go (in the editor, from 0,0,0) of a child go, that has a dynamic collision object, results in the co (incorrectly) flying off at speed.

Starting from a blank project:
(1)Turn on Physics debug.
(2) Create: Collection->go1->go2->collisionobject->box
(2.1) Create go1 and go2
(2.2) Add go1 to the main collection.
(2.3)Add go2 to go1
(2.4)Add a Collisionobject to go2.
(2.5)Move go1 by any small amount.
(2.6) Run the game and the co flies rapidly.

Moving go2 is the thing to do, not go1. I guess this is not a bug, but I think it is a ‘gotcha’.
Is there a Defold gotcha list?

Looks like GO2 gets vector speed equal to GO1 displacemnt from pos(0.0.0). But I’m too newbie to answer why is that.

I replicated this but also added sprite with particle image, to show GO1 pos. Works exactly the same no matter if debug physics is on or off. CollisionObject type is Dynamic, for Kinematic nothing happens.

Maybe screenshots and videos will be helpful for someone better at Defold than me to explain this to me and @iotaHum :slight_smile:

GO1 at pos(0.0.0). GO2 just falls with gravity, GO1 stays in place.


#2 GO1 slightly off – pos(2.2.0). GO1 stays in place, GO2 is launched by vector of GO1 offset from (0.0.0).

Video (recording started after about 1s):

Thanks for taking a look.

That I turned on to visualise the collision-object. Using a collection in place of go1 stops it happening, I just need to remember to do that I guess.

1 Like