Closed usedatiek closed 2 years ago
In Forge2D you shouldn't set the position directly (you can do it with setTransform
but it's not recommended), use component.body.applyImpulse
or component.body.applyForce
is the real way to go.
These docs are pretty good for box2d and fairly easy to understand and translate to Forge2D:
https://www.iforce2d.net/b2dtut/constant-speed
Now I can do the moves I expected! Thanks for the quick answer 😄
PositionComponent was driven by redefining position as follows.
However, since BodyComponent's position is only get, it cannot be redefined and cannot be moved horizontally. If there is a way to handle this, could you please let me know?