1 decade ago by flexelektro
Hello !
My starting point is the physics demo with the box2d plugin.
I wanted to find out when a entity has ground under his feets.
in my player.js:
This should work, but it behaves different depending on if i stand on a entity or a collision tile.
standing on a tile: normal.y is SMALLER 0 (like it should)
standing on an entity(crate ie): normal.y BIGGER 0
i really can not find out... any help ?
My starting point is the physics demo with the box2d plugin.
I wanted to find out when a entity has ground under his feets.
in my player.js:
for( var edge = this.body.m_contactList; edge; edge = edge.next ) { // Get the normal vector for this contact var normal = edge.contact.m_manifold.normal; console.log(normal.y); } ...
This should work, but it behaves different depending on if i stand on a entity or a collision tile.
standing on a tile: normal.y is SMALLER 0 (like it should)
standing on an entity(crate ie): normal.y BIGGER 0
i really can not find out... any help ?