in C++ projects.
PhysicsBody::applyForce(Vec2 force) Works like PhysicsBody::setVelocity(Vec2 velocity)
it seems bug.
both 2 gif is completely same code.
code is below
void HelloWorld::onEnter(){
Layer::onEnter();
schedule([=](float dt)->void{
Node* n = Node::create();
n->setPosition({50, 200});
n->setPhysicsBody(PhysicsBody::createBox(Size{40, 40}));
n->getPhysicsBody()->applyForce(Vec2(10000, 0));
n->getPhysicsBody()->setGravityEnable(false);
addChild(n);
}, 2.0f, "scheduele");
getScene()->getPhysicsWorld()->setDebugDrawMask(PhysicsWorld::DEBUGDRAW_ALL);
}
3.10
.
3.16
.
below is applyForce(Vec2(1000000, 0))
(in v3.16)
Need to fix this