im still learning to code lua, thats why im doing the war battles tutorial.
But i want to modify the war battles mechanics, so that the bullets would face the mouse and fly in its direction.
So i want to know, is it possible to get the angle the mouse is in as a variable, to replace this part:
if self.firing then
local angle = math.atan2(self.dir.y, self.dir.x)
local rot = vmath.quat_rotation_z(angle)
local props = { dir = self.dir }
factory.create("#rocketfactory", nil, rot, props)
end
and if it is possible to do that, please reply
thank you