• 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!

GML AIM ASSIST

zampa

Member
I what to give my bullets some aim assist to make it a little easier to hit enemies, a was thinking about different ways to do this, I would draw some collision lines to detect the enemy object before the bullet fires, if the lines detect something they set the new direction otherwise the direction is unchanged.

That's how i would do it, are there some other ways?

thanks
 

obscene

Member
I've done this a little but the results were sometimes a little glitchy and so I removed it. (So take my advice with a grain of salt). But when aiming, I tried to look at every enemy (parent object), get the point_direction from the player to the enemy and then compare it to the current aim angle. If it was within 10 degrees I would just snap the aim to the enemy. To do it properly though you would may want to sort it so that you are either assigning the aim-assist to either the nearest enemy within 10 degrees, or to the enemy that's angle is nearest to the aim. That's where it can get tricky if you have multiple enemies on the same line. May or may not matter depending on your game.
 
Top