Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
Tags
0
Members

P2 physics constraint not working

A topic by jmintb created Apr 06, 2016 Views: 480 Replies: 1
Viewing posts 1 to 2

I cant get the p2 physics constraints of any type to work, I use the following code:

this.rope = new p2.DistanceConstraint(this.actor.p2Body.body, player.p2Body.body, p2.Constraint.DISTANCE, {
localAnchorA: [0, 0],
localAnchorB: [0, 0],

});

and I get the following error:

"Uncaught TypeError: Cannot use 'in' operator to search for 'localAnchorA' in 1"

I am not sure if I am doing something wrong or if this is a bug, has any one else been able to create a p2 physics constraint?

(+1)

Solved on the github issues, this is due to errors in the typescript api bindings or whatever is the correct term for them not matching the p2 javascript below. fixes have been done and pushed up by some nice chap so anyone reading this having issues with the p2 stuff go fetch the newest files from the repository.