# bullets need to fly in a spiral (bullets on a path?)

hi al!

i got a gun shooting some bullets!
but i want them to fly in a spiral when i shoot them!

something as this:

can i make a path or something? or is it possible?

thanks!

Why not just use spiral mathematical function? What i mean, write it in python, it really shouldnt be that hardâ€¦

i canâ€™t write python so i donâ€™t know how i have to do that!
and why: yes that is a good question, iâ€™m making a kind of space game! and i want my bullets fly in spirals!

Python is very easy to learn, as programming languages go. Learn python!

Just move the bullet along one of itâ€™s local axis while rotating it around a perpendicular axis by an increasing variable. For example, move the bullet along the x-axis at a set speed, give the bullet a radius property set at zero. Each time the bullet is moved along the x-axis, rotate it along the z-axis by the amount defined in the radius property. This will make the bullet move in a circle, gradually increasing the radius property will cause the bullet to rotate on the z-axis faster, which will result in smaller circles. Simply add some logic to test if the radius property has reached/passed a set value, if it has, destroy the bullet.

Quick Attempt:

``````
cont = GameLogic.getCurrentController()
bullet = cont.owner

actMove = cont.actuators["Move"]
cont.activate(actMove)

bullet.endObject()

``````

### Attachments

spiral.blend (137 KB)

Wouldnâ€™t it work simply to have the bullet move forward and while rotating to an angle slightly? I may be mistaken, but I think it might work.

Or you could just have the object center offset, so you could add a constant rotation and that would make a spiral.

Just for clarification, do you want it to spiral, or corkscrew- IE do you want it to increase the radius of its rotation, or move as though it were going around a tube?

Corkscrewing is simple- parent the bullet to an empty, and have the empty move forward and spin around its forward axis, so the bullet orbits around it. I donâ€™t recommend having the bullet objectâ€™s center offset, to ensure collision works right. Spiraling could be done by doing the same thing, only also having the bullet move away from the empty at a constant rate.

Just move the bullet outward from the origin. Then, use the ipo curve editor to extend rotation on the axis that makes your bullet spiral, like the y axis.

Really easy way to do it, make an empty that fires the bullets, and make it slightly rotated on the x axis, then make an ipo that makes it always rotate around the y axis.

Or do you want a cylindrical spiral? In that case, just use two empties.

Here is an example of both.

### Attachments

Spiral gun.blend (154 KB)

its more like hendore made it, but the bullets are going in the wrong direction!

you see?! thats what i want!
thanks guys that you want to help me!
e.m.

you would need a initial offset, or the bullet would always fly like:
left-right-left-right

Right here!!!

### Attachments

SPIRAL.blend (184 KB)

mm nice! but how do i do that?!
i already have a shooting gun? how can i change that?

well give me the gun and i will make all the set up!

here it is! when you open it, you will see the space ship in a maze!
in the space ship you will see the gun!
the bullet is in layer 2
fileâ€¦

and how sholud i modify your file if autostart is on?>

oeps! here is he again!

http://www.filedropper.com/wotan-movement-in-maze_1

is it working??