I am making a basic shooter game where I need to create bullet on mouse click and shoot it. To create the bullets during runtime I’m using
But when I trigger the rotation and linear impulse (tried with onBeginContact and a function in the entity) nothing happens. When I use the same code on an entity already loaded on the scene it works just fine, but not on the entity created at runtime. Is this a bug or am I doing something wrong here?
boxCollider.body.rotation = 90; entity.rotation = 90; var localForwardVector = boxCollider.body.getWorldVector(Qt.point(1500,0)); boxCollider.body.applyLinearImpulse(localForwardVector, boxCollider.body.getWorldCenter());