-- Collision help! --

Official forum for the Chipmunk2D Physics Library.

-- Collision help! --

Postby kiwipxl » Sun Aug 16, 2015 10:43 pm

Ah... there's a lot of spam in this forum right now... I doubt the forum's active enough, but I thought I'd try anyway. So I've read a few threads with very similar problems as mine, but I still haven't found a solution. I'm using cocos2D-x c++ and using the in-built chipmunk framework. Basically, I want my player to walk up and down a slope at a constant speed. I also don't want them to slide down and I don't want them to really accelerate either when moving, I want it to be pretty instant. Right now, simply setting the velocity works. Except, because there is no swept collision support in chipmunk, my player is going into walls when moving into them.


In the image above, I'm moving right. Not only does this make me move into the wall, but for some reason I also slowly slide up the wall by just pressing right. I know it's bad to set the velocity every frame and why this is happening, but I'm wondering if there is any work-around that also allows me to satisfy the above (not sliding down slopes, constant speed, ect). Note: I don't slide down slopes when I set the physics material friction to a high value, so that's working right now.
I'm fine with not using any physics at all, but I require the collision that it provides. I know chipmunk is good, but I've heard that's a weak point of it. I think I can use raycasts to detect the collision, but I'm unsure this would work well when going up slopes. I would also try use box2D if I could, but it would take a while to get everything working as expected again and I don't exactly have infinite time for this game, so I don't think that's an option.

So yeah, what can I do in this situation? Any advice would be awesome :)
Posts: 1
Joined: Sun Aug 16, 2015 10:24 pm

Return to Chipmunk2D Physics

Who is online

Users browsing this forum: No registered users and 1 guest