Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Preventing box2d player from pressing against walls in midair

I have setup a box2d world with a keyboard controlled player. The player can walk and jump. How do I prevent the player from "sticking" to walls while jumping and pressing the directional key towards an object?

enter image description here

like image 533
Mattias Avatar asked Nov 20 '11 22:11

Mattias


1 Answers

Make player body as group of bodies (add fixtures at left and right sides)? and set friction to 0 enter image description here

like image 170
zaynyatyi Avatar answered Sep 28 '22 06:09

zaynyatyi