[SOLVED] Throw a Crow - example - moving elements

@britzl - I am analysing your example. My question is this. What is the reason for the blocks moving all the time, causing them to fall over by themselves after a few seconds. How do you solve this problem?

2 Likes

The reason is that the objects doesn’t seem to come to a rest, but instead agitate each other and gain more speed.

I’m not sure why this would happen if the initial setup is good enough (so that they don’t fall into place with enough force)

1 Like

It would be good to understand what is occurring here and how to fix the problem.
I could not find details in the manual on the physics engine and parameters.
It appears that there is some inconsistency in the setup.
Physics debug shows that the collisions between the blocks never stops.
Changing the value of gravity from -1000 to -10 fixes this. It also results in everything floating around when the crow hits the blocks, which is not what is wanted.

My guess is that there is an easy fix for this as the unwanted shaking is very large, so what is causing it will also be very large.

1 Like

I haven’t had time to look into this, but I would guess that the physics scale in game.project should be tweaked to avoid this.

1 Like

Thanks for your suggestions. I tried changing scale, that didn’t work for me. No worries, don’t spend time you have not got, no rush:-) At some point I will go and find out about box2d, no time now:-)

2 Likes

Increasing the velocity threshold to 50 or more improves things a lot. This now allows for multiple throws of the crow. Reducing collision restitution can also help.

1 Like

Guys, thank you for the tips !

1 Like

I checked. I changed the settings, checked many values according to the manual. I have not been able to get a properly working version.

But, I ran the example on defold version 1.2.163 and here everything works correctly.
So, some engine changes are causing what you see in the video.

Well, I found it. This parameter must be set to zero (the default is 1) :slight_smile:

image

1 Like

Yes that makes it work. It would be good to know why and what setting zero does here, maybe it makes it a derived value?
Also box2D needs a fixed timestep to resolve collisions, otherwise it can go haywire, this is not the default (1.4.8) and needs to be ticked.

1 Like