Trouble with Physics collisions

Get help using Construct 2

Post » Thu Apr 05, 2012 12:24 pm

Hi guys! I looked for a solution for this problem on the boards but I couldn't find that anyone had run into the same problem.

Basically what I've done is a platform game in which the player has an ability to temporarily phase out of the physical world to get past (i.e move through) certain obstacles. This is done by toggling off the Physics collision with these obstacles for a short while. Currently the game is set so that the player dies when he collides with one of these objects, mainly to make it clear that a collision happened.

It works well some times but whenever I "phase" when I'm already close to an object the phasing doesn't work properly. The player fades out and doesn't die when he collides with the object, but he can't move through them either for some reason. Also when the phasing ends when the player is in the middle of an object he is sort of stuck there instead of dying. In the game he's supposed to die if that happens as timed jumps are a big part of the gameplay.

If anyone of you have any idea as to how I can solve it I'd be very grateful indeed.

Here is the project, just be warned: there is a loud Wilhelm scream played when the player dies so don't play it with the volume turned up. ;)

http://dl.dropbox.com/u/4740683/Phasing.capxHemul12012-04-05 13:23:52
B
12
S
3
G
5
Posts: 21
Reputation: 3,765

Post » Thu Apr 05, 2012 3:18 pm

Disabling collisions doesn't work if the objects are already in or near contact (it's a limitation in the physics engine we use). Maybe try swapping the object for an identical one without the Physics behavior.
Scirra Founder
B
359
S
214
G
72
Posts: 22,952
Reputation: 178,600

Post » Sat Apr 07, 2012 5:57 pm

That's a clever way around it. :)

I'll just have to figure out a clever way to move the object to the player's position but I think it'll work out somehow.

Thanks, Ash. :)
B
12
S
3
G
5
Posts: 21
Reputation: 3,765


Return to How do I....?

Who is online

Users browsing this forum: Yahoo [Bot] and 18 guests