How to shoot the bullet horizonly?


I've seen a video on YouTube where bullets are generated and fired. But it was launched using the coordinates of the mouse.(instance_create_layer(mouse_x,mouse_y..) Is there a way to shoot a bullet horizontally? :)
Last edited:

Liam Jacobs

Hi there! Could you link the tutorial?

I assume (due to lack of information) that the bullets have their 'direction' variable changed, as well as their 'speed' and are rotated + moved accordingly.
If this is the case, you could simply set the direction to 0 (right) or 270 (left - see the chart below for degrees in GM) and then set the speed.

If you want to create the bullet relative to the object firing it, you can use relative coordinates (I.E. instance_create_layer(x + some_value, y + some_value, layer, object))

Here's an image depicting angles in GM (or rather on computers, in general):