1
Ask a Question / How to have a tank shoot a bullet?
« on: April 29, 2012, 06:24:44 pm »
Hello,
I'm working on a game where a tank always points in the direction of the mouse, and when the mouse is pressed a bullet actor is created supposed to fly straight out of the barrel of the tank, so I thought of this:
Create bullet at x: center of tank y:center of tank
And this for the bullet:
Point in direction of tank.
Set velocity to 30 dir: direction of tank.
This only works when the tank is facing straight up and down and I can't think of a consistent behavior. Would someone please help?
I'm working on a game where a tank always points in the direction of the mouse, and when the mouse is pressed a bullet actor is created supposed to fly straight out of the barrel of the tank, so I thought of this:
Create bullet at x: center of tank y:center of tank
And this for the bullet:
Point in direction of tank.
Set velocity to 30 dir: direction of tank.
This only works when the tank is facing straight up and down and I can't think of a consistent behavior. Would someone please help?