How do I stop physics objects from shaking?

Get help using Construct 2

Post » Tue Apr 07, 2015 10:19 pm

I am making a game in which a bunch of blocks fall down into a grid. The player then has to make matches of 3 or more of like color, similar to Bejeweled or Candy Crush Saga.

When my blocks fall into the grid, I want them to accelerate and bounce, so I gave them a Physics behavior. They bounce nicely, but some of them will never come to a complete stop. They continue shaking and vibrating forever. The vibration is very small, maybe just 1 pixel up an down, but since the object never comes to a complete rest, the Physics behavior continues to be active forever.

Is there a way to stop the blocks from shaking?
B
6
Posts: 3
Reputation: 260

Post » Wed Apr 08, 2015 12:31 am

Have you tried using the physics actions Physics enabled/disabled?

Once the object reaches its destination grid space, or stops moving in Y values, or whatever have it set the objects physics to disabled and turn them back on again when they are needed to drop again.
B
40
S
8
G
3
Posts: 546
Reputation: 5,085

Post » Wed Apr 08, 2015 4:29 am

You may want to look into moving the blocks around using a plugin like "Litetween" instead of using physics. It may be easier to control exactly the shapes, and be overall higher performance.
B
63
S
26
G
9
Posts: 863
Reputation: 11,697

Post » Wed Apr 08, 2015 7:30 am

Or you could use Chipmunk Physics behavior and set the sleep threshold.
B
46
S
16
G
9
Posts: 1,096
Reputation: 11,153

Post » Wed Apr 08, 2015 7:32 am

Using physics for something like this does seem overkill, bullet-behaviour with gravity would do just about the same.
My guess is you should check your collision-polygons or set collision-mode to bounding box.
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
53
S
16
G
8
Posts: 6,157
Reputation: 19,744

Post » Wed Apr 08, 2015 1:55 pm

Thanks for the useful responses! I will look into using non-physics alternatives to improve the performance of the falling blocks. Either that, or disable physics once each block reaches its destination.
B
6
Posts: 3
Reputation: 260


Return to How do I....?

Who is online

Users browsing this forum: increase, Mik07 and 1 guest