GMS 2.3+ Physics based blocks will not stop moving.

Zeth_Aran

Member
I've been working with the GM2 Physics engine a little bit to try and see how it all works. I have a test project I've been working on for it. Every tutorial I find is too old or not being actively discussed so I'm hoping someone can point me in the right direction. Here are screenshots of the obj_box, obj_block (which is supposed to function like a wall or floor.) and its parent par_block. My issue is that any time obj_box is on top of obj_block or itself, it will begin to shake and jiggles the entire structure. Is there anyway to make this stop? Or is this a current bug in the physics engine?

Room Physics settings

Enable Physics is checked.
Gravity X : 0
Gravity y : 80
Pixels to Meters : 0.1
 

Attachments

Slyddar

Member
Try to set the density to zero on both objects. And you need to either do it in code in the parent objects create event, or do it on the childrens physics tab. Children do not inherit from the physics tab of the parent.
 

Zeth_Aran

Member
Try to set the density to zero on both objects. And you need to either do it in code in the parent objects create event, or do it on the children's physics tab. Children do not inherit from the physics tab of the parent.
Setting the object's density to zero stops the jiggling but I'm no longer able to interact with obj_box. I think I might have to create a collision system that only activates the physics system when needed?
 

Zeth_Aran

Member
Okay after doing some tinkering, I've discovered that the wiggling I'm experiencing comes from my gravity being stronger that the objects can handle in an idle state. Looks like my system just needs some fine tuning on values to get the game feel that I want. If the gravity is too strong and the density is not high enough, the objects will begin to move seemingly on their own because it doesn't reach some sort of balance. I changed the room gravity from 80 to 30 and have lost the wiggling effect.
 

Gamebot

Member
It was hard for me to see your pictures on my phone....and the way you had the large numbers 30 and 80 I thought you were literally using those for your inputs in the physics box...I see now your using smaller numbers between 0 and 1. Sorry.
 
Last edited:

Zeth_Aran

Member
It was hard for me to see your pictures on my phone....and the way you had the large numbers 30 and 80 I thought you were literally using those for your inputs in the physics box...I see now your using smaller numbers between 0 and 1. Sorry.
That's okay!
 
Top