Vcam + mouse position bug

My Project (2).wick (5.8 KB)
so, i started working on a roguelike shooter. i made the vcam follow the player, and the player’s gun point to the mouse using mouseX and Y, and javascript’s atan2 function. the problem is that, whenever the player moves (and so the vcam) the gun points to to mouse’s previous position and doesn’t update until the mouse is moved or clicked.


i assume, based on absolutely nothing, that wick’s (or candlestick’s, since that’s what im using) mouseX and Y values don’t update until the mouse is changed in any way. help would be appreciated.

oh, and you’ll notice that the bulllets come out of the center, not the muzzle. this is because the bullet clip that im cloning is cloned at the gun’s position, which is not the muzzle. i think this can be fixed with trigonometry, but idk how. help on that would be nice too.

I can kind of see your problem now that I’m testing it out. It does work… but it only shoots stuff within the stage.

…now I’m not sure how to fix this because I’m just an animation guy but I now know that there’s something else going on…