Hi,
I'm in the process of making a box2d platformer (don't look at me like that! I have good reasons, I swear!). I's going well, except that there's a bit of wallstick.
See image:
How can I avoid this?
Thanks,
Nsmurf.
Box2d wallstick
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
- ejmr
- Party member
- Posts: 302
- Joined: Fri Jun 01, 2012 7:45 am
- Location: South Carolina, U.S.A.
- Contact:
Re: Box2d wallstick
Please upload/attach a '*.love' file so that we can see the code. That really, really helps debugging.
Re: Box2d wallstick
Here's the .love, but I'm fairly certain it's a box2d issue, not a coding issue.
- Attachments
-
- stuff.love
- The .love in question.
- (41.48 KiB) Downloaded 67 times
Re: Box2d wallstick
That looks like it'll fix it, but I'm gonna wait until tomorrow to try it. Thanks!
Re: Box2d wallstick
I believe this is caused by the "inside edges" problem where objects get stuck between the ledges of box shapes. It could happen when moving on top of horizontal platforms as well:
I read somewhere a simple and hacky solution to this problem - make your INSIDE tiles overlapping hexagons:
b is an inside tile and a & c are outside tiles.
So basically you have to create a hexagon shape for inside tiles (like b):
This would push the player away from the platform so he wouldn't get stuck:
Code: Select all
__
<---/ \
__ ____\__/___
| | |
| | |
Code: Select all
_____________
| a | b | c |
| | | |
-------------
So basically you have to create a hexagon shape for inside tiles (like b):
Code: Select all
_________
/ \
/ \
\ /
\_________/
Code: Select all
_____ ________ _____
| /| |\ |
|a / | b | \ c |
| \ | | / |
|_____\|______|/_____|
Who is online
Users browsing this forum: Ahrefs [Bot] and 5 guests