Issues with physics and platform

Get help using Construct 2

Post » Wed Oct 16, 2013 10:33 pm

Hi everyone!

This is a little prototype that i'm work on:
http://decodeweb.com.br/newgame/

The black box is the player; yellow box is a boudingbox with physics applied in; and the blue one is a box, with physics.

The problem is: sometimes, when the player is pushing the blue box, it passes through the box, even when the floor is rect.

Whats the problem?

Thanks for the help! (sorry for my bad, bad english :P).

Capx file: https://www.dropbox.com/s/tnkmsluzgqnbw1m/new_game-2ecely359k9od.capx
B
5
S
1
Posts: 3
Reputation: 581

Post » Thu Oct 17, 2013 3:30 pm

Anyone?
B
5
S
1
Posts: 3
Reputation: 581

Post » Thu Oct 17, 2013 4:14 pm

I'll just make it simple.

Don't mix platform and Physics.

This is a mistake that most new C2 users make when wanting to get both the platformer toolkit and the physics toolkit. The problem is that Physics uses Box2D which is NOT part of the platformer kit. Box2D is it's own API entirely and does not play nice with Platformer.

You can mix them, but the grief it will cause you a lot of grief trying learn the in's and outs of handling both.

If you want Physics. Then you drop Platformer and have your player also a Physics object. You won't get the nice triggers, but it will work the way it should.

If you can sacrifice physics. Then I suggest dropping that.

If you want both. it's going to be a lot of work. The reason for this is because Physics objects shuold be moved by physics controls. So even layering a physics object on the player will be problematic as Platformer would be setting the position of the physics object. This will cause Physics behaviour issues and not a desired effect.

B
90
S
18
G
9
Posts: 2,455
Reputation: 15,018

Post » Thu Oct 17, 2013 11:47 pm

I see. Im already awareness of this issue. Because of this, I'm trying to use a "boudingbox" around the player. Player have the PLATFORM behavior, while this "boundingbox" have the PHYSICS one.

Then, i "stick" both together, to make physics interations with world (like pull/push crates, even in a inclined surface).

If you check the little prototype at http://decodeweb.com.br/newgame/ you will see what is the problem. When I try to push the box, the box moves. But sometimes, it "passes" through it, specially when you pushes from right.

If I use only the physics in objects, the same problem occurs. The Capx file is in the first post.

Thanks for the help!
B
5
S
1
Posts: 3
Reputation: 581


Return to How do I....?

Who is online

Users browsing this forum: AndreasR, Artepi, karthikavnair, Rable and 15 guests