get absolute direction of camera

Hi!!!
I want to create a bullet when player clicks on mouse1 button. I accept this event linking at createBullet function. I load the bullet model, set his position and rotation as camera. Now i want that my model goes right.
How can i do this?
I tried to use hpr with cosine and sine functions but the effect isn’t right!

I think the solution to your problem is pretty simple: Add a task every time you fire a bullet that makes it move in a straight line, inheriting the camera’s rotation. So, this is what you would put in the task’s body:

bullet.setY(base.cam, bullet.getY() + 1)

@DangerOnTheRanger

That code won’t work. First of all, you’re using two coordinate spaces there (base.cam’s space and whatever the bullet is parented to), and secondly, any change in the camera’s direction during the bullet’s movement would result in the bullet turning.

It would be more like this:

bullet.setY(bullet, 1)

Assuming the bullet is oriented correctly.

Still, the ProjectileInterval is built to handle this kind of situations, so it should work here.

Oh, nice catch - sorry about that.