stuck with physics behavior

For questions about using Classic.

Post » Mon Dec 06, 2010 12:19 am

Hi everyone,

I'm new at this board, just playing for 10 days with construct and love it.


At the moment i'm stuck :( with physics behavior, and hope someone can help me to get this example working.

The player green have to push away the gray blocks.
First block looks if it's working fine but when the blocks are laying still it won't work and you can just fly trough it.

http://dl.dropbox.com/u/16288442/MoveRock.cap
B
43
S
8
G
5
Posts: 110
Reputation: 3,605

Post » Mon Dec 06, 2010 6:08 am

This is one of those tricky problems that doesn't have an easy fix. The physics behavior generally doesn't work well with other behaviors, working in an unexpected manner.

Here's an example that mostly fixes it while still using the 8 directions behavior, with an explanation afterwards:

Fix thingy

What this is doing is making sure that all physics objects are constantly in motion, even if just a tiny amount. Two physics objects that are in a state of rest can't interact.

Since the green object is being moved by another behavior, the physics behavior always considers it to be in a state of rest, thus no interaction will occur between it and any other physics object. To fix this, you must stimulate the objects yourself with a small amount of force to bring them out of that resting state, and thus, interact.

Ultimately, it might be a better idea to try and create the movement you're needing solely with the physics behavior. While it might be tricky to get it working initially, it will probably prevent further headaches with this issue in the future.

I hope this helps. :)
Moderator
B
98
S
37
G
19
Posts: 1,584
Reputation: 17,817

Post » Mon Dec 06, 2010 7:46 am

Thanks a lot, you have helped me out a nightmare.

I need to trigger now the speed down before it hits the rock/block, then it looks fine, but I agree, its better to avoid using this kinda stuff, but anyway I really needed this in a level to solve a kinda quest what I had in mind so thanks again :) you have made my day... oops night :).
B
43
S
8
G
5
Posts: 110
Reputation: 3,605


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 3 guests