ChubbRck Posted April 16, 2014 Share Posted April 16, 2014 Hi all, Trying to make a P2 body accelerate (as opposed to using moveLeft) but am having a tough time, tried to use applyForce like this: basket.body.data.applyForce([100,100], basket.x, basket.y);As well as this.. basket.body.data.applyForce([100,100], [basket.x, basket.y]);with no results. Anyone know what I'm doing wrong? I have tried changing the 100 to a number much larger as well as change gravityScale back to 1 (it is currently at 0). Thanks - Nick Link to comment Share on other sites More sharing options...
schteppe Posted April 17, 2014 Share Posted April 17, 2014 Think you need to use the second version. And you also need to do it every frame. Is that what you do? If it does not work, you can always do this (every frame):basket.body.data.force[0] = 100;basket.body.data.force[1] = 100;The .applyForce method does this - adds to the force vector. Stefan Link to comment Share on other sites More sharing options...
Recommended Posts