[Resolved] Physics bug?

I have this problem now for a couple of days and I tried alot off things but I can’t find the problem! Pulling my hair out!!

I have a button in my game which turn on the physics. And also a reset button.

But sometimes when i press the physics button the physics doesnt seem to work. Sometimes the character will not fall down (like the gravity is still of) and sometimes he will fall trough the ground and other objects!

But most of the time it works perfectly! And I also cannot seem to find a certain pattern in the bug. Also it doesnt give any errors or warnings. And also I tried to put print(); lines around every little part of code that should turn on the physics, but even there it seems that everything is exactly doing what its supposed to do. Its making me crazy I cant understand how it is possible that 1/30 times it goes wrong without any errors. Also I checked it in ADB on my android devices and also that does not give any errors, but still I get the bug sometimes…

I am using the trial version for OSX [import]uid: 118839 topic_id: 24910 reply_id: 324910[/import]

Have you tried adding a slight delay between resetting positions and turning physics back on? (I might be grasping at straws but it sounds like an odd issue.) [import]uid: 52491 topic_id: 24910 reply_id: 101199[/import]

I will try that. It seems like its sometimes skipping things and sometimes not so that may help. I will post whether or not it helped :slight_smile:

I also think it is odd cause it happens random and doesnt give errors… [import]uid: 118839 topic_id: 24910 reply_id: 101604[/import]

Hi Peach!

Thanks for your tip!
I put a timer from 10 milliseconds in my reset.lua, between my level purge function and load level function.

So how i see it, between deleting my current level and reloading the level, the timer gives the game the time to properly do everything without creating bugs. Because before the purging and recreating was going to fast.

I already reset the level a lot off times and it seems to give no bugs anymore, so I think it has been fixed! [import]uid: 118839 topic_id: 24910 reply_id: 102653[/import]

Hey Alexander,

Right, well, I’m very happy to hear that! I’m going to mark this as resolved.

If you encounter any more issues please update the thread and I’ll walk you through filing a bug report if needed.

Peach :slight_smile: [import]uid: 52491 topic_id: 24910 reply_id: 102665[/import]