Closed romaniom closed 11 months ago
Sorry - missed this until now! You can get us faster at https://zimjs.com/discord or https://zimjs.com/slack. Physics objects are supposed to be controlled by forces. So you want to apply an impulse(x,y) when you press the button.
const button = new Button().center()
button.on("mousedown", ()=>{obj.impulse(100,0);});
will shoot the object to the right for instance.
hello! I have connected box2d in my project, I need the ball to move at the touch of a button. But nothing works, I've tried a lot of ways, with physics connected, nothing works except impulse and keyboard movement. But I need the ball to move when the button is pressed. Animation doesn't work either.