• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

Windows Mouse sight problem

I need some help! the bullet is not firing at the center of the crosshairs all the time. It was working I bought a new monitor and I'm still using it at the same 1920 x 1080 resolution it may not be related to the monitor it may be a game maker update! the crosshair and bullet are set to "middle centre" and the "bullet fire" code is:

GML:
if mouse_check_button(mb_left) && global.shotzz == "mb_left"
{
if (global.atira == 2 && global.firi == 2 && global.subammo > 0) 
    {
    global.firi = 0;
    audio_play_sound(Shot, 20, false);
    instance_create(mouse_x, mouse_y, OX);
    alarm_set(11, 15);
    global.firi = 0;
    global.subammo--;
    }
if global.atira == 2 && global.firi == 2 && global.subammo < 1
    {
    global.firi = 0;
    audio_play_sound(Fail, 20, false);
    alarm_set(11, 15);
    }
if (global.atirax == 2 && global.foguex == 2 && global.canammo > 0)
    {
    global.foguex = 0;
    audio_play_sound(Shotgun, 20, false);
    instance_create(mouse_x, mouse_y, OXE);
    alarm_set(9, 30);
    global.foguex = 0;
    global.canammo--;
    alarm_set(11, 05);
    }
if global.atirax == 2 && global.foguex == 2 && global.canammo < 1
    {
    global.foguex = 0;
    audio_play_sound(Fail, 20, false);
    alarm_set(9, 30);
    alarm_set(11, 05);
    }
}

// crosshair
cursor_sprite = Mirasub;
it was working now a i need help
 

Attachments

Last edited by a moderator:

Nocturne

Friendly Tyrant
Forum Staff
Admin
What version of GameMaker are you using? You're still using "instance_create" which would suggest a pre-GMS2 version, so it's impossible that it's a GM update causing the issue. Also, the code you posted (which I fixed for you in the post - please ensure that your code is correctly formatted and in [CODE][/CODE] tags) has nothing related to setting the direction of any bullet objects and seems irrelevant to the issue you are describing? How are you telling the bullets to aim at the mouse cursor?
 
It was working. Now with the new monitor the bullet "dances". They don't always shoot from the center of the crosshairs. I tried to change the custom sight for one of the system and nothing. The bullet and the crosshair are with the mask centered. The code for bullet leaving the center is:


GML:
instance_create(mouse_x, mouse_y, OX);
Game Maker 2
Made with Game Maker 1.X and Upgrade to Game Maker 2
 

TheouAegis

Member
What if you disable the cursor and put in the Draw End Event
Code:
draw_sprite(Mirasub,0,mouse_x,mouse_y)
If that fixes it, then that would mean there is something wrong with the actual cursor, somehow.
 
Top