Wanting an enemy to fire a bullet

i’m currently in the process of creating a boss for my test game, and since i want the boss to be a projectile based boss, i decided to use the code from the system that’s set up to allow the player to fire a projectile. the problem is that i can’t figure out how to tweak it to fire out randomly. i’ve done the first bit, making the angle random, but I’m struggling to get the bullet to actually move. i know what i need to change, and i think an incrementing system using recursion might work. i need to replace the dir variable since that was based on player movement(i think.)
image
i think this is another case of me missing something simple

here’s the other part in the boss’s script(the other one is the projectile script)

local angle = math.random(1,180)
	local rot = vmath.quat_rotation_z(angle)
	local pos = go.get_position()
	factory.create("#bossfactory", nil, rot)

Ok, what you’ve done so far is to rotate the bullet when it is created. Next is to move the bullet in the direction or is facing. There’s an example here: Move forward

Right. Knew I missed something simple, thanks.