1. Ratsha

    GMS 2 2D Hitscan

    GM Version: GMS2 Target Platform: ALL Download: N/A Links: N/A Summary: How to implement hitscan in 2D games using collision_line(). Tutorial: Code below for the hitscan code in Left Clicked Event. This includes a fix (gun_direction) that accounts for the gun's slightly offset in the Sprite...
  2. MegaJim73

    GML [GM8] Hitscan shotgun code

    I've been tinkering the hitscan code I made in my previous thread for a shotgun in my FPS but it has a couple of quirks that keep it from functioning as intended: When aimed at an enemy, only up to three 'pellets' will hit the enemy and do damage, regardless of how many 'pellets' are fired...
  3. MegaJim73

    [Sort of solved] Hitscan won't hit pillar

    I'm trying to implement a hitscan system in an FPS I'm making. It creates the appropriate impact when the gun hits an enemy (obj_enemy_basic) or wall (obj_wall_basic), but simply passes through when it hits a destructible pillar (obj_pillar). Help would be gladly appreciated. { // check...
  4. B

    GML Multi-Directional Hitscan

    Hi! I'm new here, and working on a Game Maker Project for my college course on Interactive Media - and I'm a little stuck when it comes to what I'm making. I'm creating a game in which the player must escape an enemy playing by Weeping Angels rules - it cannot move when directly viewed. To...
  5. jujubs

    GML [SOLVED]collision_line weird behaviour

    I'm trying to do a hitscan weapon, and read elsewhere that collision_line was a good way to go about. So, I draw a line across the screen using this: if(test> 0) { draw_line(obj_player1.x+16,obj_player1.y-1,obj_player1.x+1000,obj_player1.y+1); } Once my player's state machine gets to...
  6. Niels

    Legacy GM collisions on fast projectiles... about to give up

    Hi everyone, I have a questions about how to implent a (easy enough for me to understand) code for for shooting enemies. my game is in a 2d platform perspective and my player character has a machine gun that fires bullets (obviously ;) ). problem is that fast flying objects actually...