Why is this not shooting in the direction I told it to?

Discuss issues specific to the Flash/AS3 port of Box2D
gramcracker
Posts: 21
Joined: Wed Feb 25, 2015 10:36 am

Why is this not shooting in the direction I told it to?

Postby gramcracker » Tue Aug 04, 2015 12:37 pm

var pVec:b2Vec2 = new b2Vec2(bullet.body.GetPosition().x, bullet.body.GetPosition().y);

var impulse:b2Vec2 = new b2Vec2(car.GetPosition().x,car.GetPosition().y);

bullet.body.ApplyImpulse(impulse,pVec);


I want someone to explain how this does not shoot at the coordinates because I am at the end of my rope. I have lost my mind trying to make box2D shoot a bullet in a direction.

I don't understand how it is not possible to do this.

Return to “Flash”



Who is online

Users browsing this forum: No registered users and 2 guests