collision checking

  1. D

    GMS 2 recognizing multiple Spine collision boxes

    Spine allows you to make multiple bounding boxes in an animation. Do any of you fine chaps know of a way to differentiate between them in GMS2? Such as during a collision event returning which bounding box the collision happened with.
  2. J

    (Solved) Collision Checking on Asset Layer

    I have a lighting system that creates a sprite on an Asset Layer. The codes below are for items that emit light. Create event: // === Emits Light Handling ========================= // ================================================== // Layer id which light sprite draws on. bp_light_emit = 0...
  3. Papa Doge

    GML [Solved] Problem with Sticky Projectiles

    Hello, I'm working on a game that has a throwing projectile that the player tosses and sticks into walls, then the player can call the projectile back and throw it again. I had the basic code setup and working fine, but my projectile sprite was going too far into the walls, so I added some...
  4. S

    Collision_rectangle, collision_line not working

    I might be missing something here, but it's not working. Here the calling instance shoots a bullet when the enemy is in collision with the given rectangle. If I do 'col= noone' instead of 'col!=noone', the bullet is shot normally. shootcount= clamp(shootcount,-6,120); shootcount++; x2=...
  5. Papa Doge

    GMS 2 [Solved] While loop crashing when storing condition as a variable

    I'm working on a proof of concept, wall climbing platformer that has some pretty basic collision checks, one of which is to check if a player is about to jump over a wall — and if he/she is — move the player sprite so that it stops at the peak instead of jumping over the peak. The issue I'm...
  6. Kodiqi

    HTML5 Handling many collisions

    GMS v1.4.1804 I have a Breakout style game which involves multiple balls (up to 1,000) and bricks (up to 100) on screen at a time. This means I have a lot of frequent collisions and I am getting some significant lag in the HTML5 version of my game. I'm just wondering if there is a better way I...
  7. Papa Doge

    GMS 2 [Solved] Collision is Preventing Jump

    I'm new to GML (and coding in general) and am having a difficult time figuring out how basic collisions work. I've watched quite a few tutorials now and the code that I'm using seems to be pretty standard. My issue, is that while my player object does indeed stop where it's supposed to, once...
  8. 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...
  9. 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...
  10. D

    GMS 2 how to make object remember collisions?

    Nevermind, I figured it out just now.
  11. Jmarlin3

    Collision Issues

    The objective is to have the player enter the cupboard with the open sprite. I right click to open, and right click to close. Code for player: //Stealth Variables if(vspeed != 0 or hspeed != 0) { noise_level = max_speed*25; } else { noise_level = 0; }...
  12. P

    GMS 2 Phantom Step Event or Script Trigger - help! [SOLVED]

    Hello! It's pleasure to be a part of the GMC. I'm new to GMS2 but am familiar with game design and programming in general. I'm running into a strange problem I was hoping to get some help on from some of the GMS vets out there. TL;DR Basically the issue is there is a specific script that is...
  13. K

    GMS 2 Why can't one press multiple keys at the same time?

    Hi. In all my recent games I have been using keyboard_check() to check whether a key is being pressed or not. But I noticed there is a limit (mostly 3 or more) keys which can be pressed at the same time. For isntance if I configured my object to move with the arrows, toggle speed with X and...
  14. Goldoche

    GMS 2 Using a sprite's collision mask without it being attached to an object?

    I'm drawing a bunch of sprites without them being directly attached to an object. I keep their positions in list data structures. I'd like to do some collision checks with them. Unfortunately they have complex shapes so I can't just use an ellipse or a rectangle. Is there a way I can use their...
  15. J

    [solved] Collision Code Not Working

    Collision code not working how I want it to.. Maybe I'm doing it all wrong? What I'm trying to do: 1) when player enters an outer range, increase boost by +2 2) when player enters an inner range, increase boost by +2 (now total of +4) 3) when moving from inner range to outer range, back to +2...
  16. D

    Legacy GM Errors with instance_place and is_undefined

    I am currently getting errors stating that "target.type not set before reading" inside an is_undefined statement, and instance stored under target should not have even been read. The relevant code used is this: target = check_hit_instance(x,y); if(target != noone &&...
  17. M

    GML Expanding Circular Collisionbox

    I need a circular collisionbox that can expand or shrink with a (variable) number value. I've tried: //STEP EVENT cor_radius = random_range(cor_rMin,cor_rMax); //randomize core size rad_radius = random_range(rad_rMin,rad_rMax); //randomize radiation zone size if...
  18. J

    GMS 2 Collision Problems

    v2.1.4.285 I am using a basic collision system(place_meeting) for my 2d platformer. But due to my tileset having to be snapped to the grid(middle centre) for edges to of tile to show. and I use a !visible object that acts as walls and floor. but I have to use 4 different objects to cover the...
  19. L

    Legacy GM Sentry Enemy Coding Help

    I'm working on a stealth game and revising some mechanics. I have a sentry enemy that used to have a constant, swiveling line of sight. I'm trying to change it at the moment so it instead lies "asleep" for a few seconds, "blinks awake" for a few seconds during which it can detect the player...
  20. D

    Legacy GM Check for collision between two other objects

    Hello. Is it possible to have an object check for collision between two other objects and have that collision affect itself? The way how I'd use it is simple. I have a camera object that snaps to the player's position based on an 800x608 grid. I want it to pause any movement when the player is...