Trouble with physics/collisions

Get help using Construct 2

Post » Mon May 21, 2012 9:20 pm

Hello again,

I am using the 8 direction movement for the player (top-down) and I disabled the world gravity, so that is not a problem. However, what I am having trouble with is collisions.

Right now I have 3 physics objects: the player (set to immovable:no, use collision polygons, prevent rotation: yes), the monster (same settings essentially except the prevent rotation), and walls which are set to immovable object.

I double checked and made sure all of these are on the same layer.

The problem I am having is this: When the player collides with a wall, well, there is no collision. The player just moves right through it without any effort (the player appears to go "under" the graphic). The monsters do the same exact thing. The player and the monsters also don't collide and instead just pass through each other (but all events associated with "on player touch" or "on monster touch" still work just fine).

Prior to this, I had all 3 objects as solids with no physics. The player could not go through the wall, but monsters still could clip through it.

Any suggestions are greatly appreciated. Thank you!
B
19
S
6
G
5
Posts: 98
Reputation: 4,484

Post » Mon May 21, 2012 11:43 pm

This is because you are using the 8-direction behavior in conjunction with physics. You cannot do this! You will have to manually apply forces based off key combinations.
B
90
S
30
G
24
Posts: 3,189
Reputation: 32,400

Post » Tue May 22, 2012 4:17 pm

It's strange because I also have randomly spawning barrels that use the physics as well. I can push them just fine with the player, and the monsters run into them and they move just fine, and the barrels collide with the wall just fine. It's just the player and monsters not colliding with the wall that's the problem.
B
19
S
6
G
5
Posts: 98
Reputation: 4,484

Post » Tue May 22, 2012 4:23 pm

Doesn't seem to be an edit button D: (edit* oops, I missed it)

Anyway, I uploaded the capx to dropbox, if anyone wants to take a look and maybe tell me how stupid I am for missing something? I'd appreciate it. Thanks!

http://dl.dropbox.com/u/13425402/ZombieTest.capxsupergodjesus2012-05-22 16:24:13
B
19
S
6
G
5
Posts: 98
Reputation: 4,484


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 24 guests