Collision not detected problem

I have a platform made of multiple squares (like bricks).
I also have a player standing on top of the platform.
When I move the player left/right on the platform and stop, most of the time, there is constant collision registered but if I get it just right (or wrong) the collision doesn’t register. Why is this?
I tried creating a sensor right below the player box but that doesn’t seem to help.
Thanks. [import]uid: 39031 topic_id: 16315 reply_id: 316315[/import]

try making your player a bullet so collisions are detected better.

body.isBullet = true  

http://developer.anscamobile.com/reference/index/bodyisbullet\

Also try making the platform one physical object instead of many.

[import]uid: 38820 topic_id: 16315 reply_id: 60847[/import]

Hi, Glenn,

I will try isBullet.
I don’t think I can get away from having ‘blocks’ of squares because it would be too much to create individual platforms (differently shaped) in different levels of the game. Isn’t using modular system like that how most Mario-type platforms are done? This is my first time creating a platform game so I could be wrong though.
Anyway, thanks for your input and I will report back! [import]uid: 39031 topic_id: 16315 reply_id: 60863[/import]

Technically yes, that’s how mario-type games are made, but they also aren’t using physics engines either. When it comes to physics, the less data, the better. So using a single large rectangle instead of 8 squares will help performance greatly.

That should probably fix the problem you are having. It sounds like the player is getting caught between the “seams” of the blocks.
[import]uid: 49447 topic_id: 16315 reply_id: 60881[/import]

Yeah, that’s what I thought, too, but by looking at it in hybrid mode, even if the player is only on one block clearly touching, it still wouldn’t register collision at times.

It would suck to have to create differently shaped platforms for every level, which means literally hundreds of them.

By the way, the reason I am doing this is to check whether the player in in air (jumping). If there is a collision, I know the player is not in air. If there is not then the player is in air.
Right now, even if the player is not in air, it thinks it is because no collisions are detected… [import]uid: 39031 topic_id: 16315 reply_id: 60888[/import]

Instead try setting a flag when the player has a collision with a ground object.

I’m currently working on a platform game myself. Here is a very early video of the game.

http://www.youtube.com/watch?v=Wbv-ClUCdj0
I’ll upload an update of the video tomorrow because I have blocks, enemies, and coins working. [import]uid: 38820 topic_id: 16315 reply_id: 60922[/import]

Wow, that looks pretty nice!

The problem is that there is no collision happening eventhough the player is clearly standing on top of a block so I can’t set a flag.
Floor is a one rectangle so it works as intended. It’s just floating platforms that have the problem.

I agree that it has something to do with using multiple objects to create one platform.

In any case, I look forward to seeing the updated video! [import]uid: 39031 topic_id: 16315 reply_id: 60930[/import]

isBullet didn’t work. [import]uid: 39031 topic_id: 16315 reply_id: 60990[/import]

I figured out the cause.
The player object stands on block1 and collision has begun.
When the player moves from block1 to block2, while crossing over the seam, block1 collision is still going on but block2 collision doesn’t begin. When the player has completely crossed over to block2, block1 collision ends and block2 collision is still not happening. [import]uid: 39031 topic_id: 16315 reply_id: 61029[/import]