Dynamic Physic Objects Still Falling Asleep

Hi I am not sure what I am missing here, I have objects, (like balls) which drop when you remove the ground it’s sitting on. I noticed that if I were to leave the balls and not touch anything for a minute they become asleep and when I remove the ground they stand on they remain in the air floating as if nothing changed.

I currently have at the top of my code

physics.start( true )

the object I created has

ball[i].isSleepingAllowed = false;

ball[i].isAwake = true;

physics.addBody(ball[i], “dynamic”, {density = 50, friction = 0, bounce = 0, radius = circleDiameter})

all these settings seem not to matter once a certain amount of time is passed and there are no longer any interactions between the balls and the wall/ground/surrounding it will stop being “dynamic”

Any idea what I missed or overlooked?

Thank you,

Harry Tran

Hi @PickionGames,

You should set the properties like “isSleepingAllowed” after you add the body to the object. Most physics properties will not apply until there’s an actual physical body associated with the object.

Best regards,

Brent

I’ll give it a shot, thanks for the help Brent.

Edit: It looks like that was the part that I needed to edit, things appear to be working as I want. Putting the properties after creating the body is what worked.

Hi @PickionGames,

You should set the properties like “isSleepingAllowed” after you add the body to the object. Most physics properties will not apply until there’s an actual physical body associated with the object.

Best regards,

Brent

I’ll give it a shot, thanks for the help Brent.

Edit: It looks like that was the part that I needed to edit, things appear to be working as I want. Putting the properties after creating the body is what worked.