How do I prevent physics object sleeping

Get help using Construct 2

Post » Sat Oct 17, 2015 6:38 pm

So I have an immovable physics wall, which uses the rotate behavior to make it spin. When my character moves into the wall, the wall pushes it for a short time before the character physics just goes to sleep and the wall starts passing through it.

a) How do I stop the physics object going to sleep?
b) I'm pretty sure the character sprite goes to sleep because its X and Y velocity show as 0 in the debugger... even though it is being pushed by the wall. Any suggestions as to how on earth that's possible??

Thanks everyone.
B
13
S
6
Posts: 130
Reputation: 1,553

Post » Sat Oct 17, 2015 7:15 pm

TMAJA take a look at this simple demo and learn from it. And if you want more then try link below


https://www.dropbox.com/s/3c698s0b3enqu ... .capx?dl=0
https://www.dropbox.com/sh/eioscti86bpr ... 7YPza?dl=0
B
252
S
39
G
15
Posts: 1,964
Reputation: 40,753

Post » Sat Oct 17, 2015 8:40 pm

Hi Lordshiva,

Thanks for your input - but it doesn't bring me at all closer to stopping the character physics object going to sleep. I already have a reasonable grasp of the physics plug in, but this is eluding me. Could anyone tell me how to stop a physics object going to sleep? (Even if its velocity is 0,0)??

Thanks!
B
13
S
6
Posts: 130
Reputation: 1,553

Post » Sat Oct 17, 2015 9:15 pm

Physics treats immovable objects as not moving so I imagine it thinks any objects in contact with it can sleep.

One idea would be to not make the obsticle immovable. Instead attach it with a revolute joint to another immovable object. Then set the angular velocity instead of using the rotate behavior.
B
92
S
32
G
109
Posts: 5,292
Reputation: 70,995

Post » Wed Jan 13, 2016 11:37 am

In the current version 216 there is a condition to check if Physics for object is sleeping. I've found that applying a force if that happens with 0 values is enough to prevent from sleeping.
B
6
S
2
Posts: 15
Reputation: 589


Return to How do I....?

Who is online

Users browsing this forum: R0J0hound and 56 guests