collision

  1. V

    GML How could I make my knockback smoother?

    How could I make my knockback smoother? I did it using lerp and lengthdir, but the transition was a bit abrupt. How could I fix this? or is there a better way to do KnockBack? collision event (Obj_shoot -> Obj_enemy) if (other.hp > 0) { var knockback_speed = 10; var...
  2. M

    GameMaker How to set the collision of an object right if I stretch the sprite

    What the title says. If I have an object with lets say a default sprite of 120 X 120 and I stretched that sprite in the drawevent of the object so like: draw event: draw_sprite_stretched(spr_button_start, subimage, x,y, 1000, 120) The object uses the old collision mask of the old sprite (the...
  3. DragonPup

    Problems with move_and_collide and TileMaps

    Ok folks I'm having a problem with tilemap collisions. I was following a quick tutorial (linked below) and looks SUPER simple. He is using move_and_collide() and the player object just seamlessly walks up tiles that are ramps. friggin' magic. However, when I try to implement something like...
  4. MedicOnFire

    SOLVED Adding Interactable Entities / NPCs to Tile-Based Collision

    Hello! I am trying to create entities (things like signposts, NPCs the player could interact with, chests to open, etc.) in my game and I am struggling to implement their collision properties to let the player interact with them using a key press (like the Enter key or E key). For context on...
  5. G

    GML Visual My character gets stuck in the wall when turning behind the mouse. I have visual code, or D&D (if you prefer).

    My character gets stuck on the wall when he turns to pick up the mouse. I have visual code or D&D (if you prefer). PLEASE PAY ATTENTION! For some reason I can't open pictures on this forum. P.s. sorry for my English. I'm Russian.
  6. C

    GameMaker Detect multiple collision points on one object

    (very new to game maker and programming languages in general) I have a particle system that trails behind the players character (which is a cube) by detecting when they are on the ground and spawning the particles at the right most side of the block. However, this has the side effect of when the...
  7. Paul Kankiewicz

    SOLVED [SOLVED] "with" Statement Fixes Movement/Collision Issue

    Hi y'all. I'm working on a multiplayer 2D platformer and ran into a weird issue that didn't make sense to me, so I thought I'd post here to see if anyone knew what's up and could tell me what might be going on. I've got a lot of AAA game dev experience, so generally when I run into an issue like...
  8. H

    Collision problem - objects going through objects they should stop at

    I'm fairly new to GameMaker so I may not fully understand some concepts. In the game I'm making, furniture flies around to hit the player. At the moment, it mostly doesn't stop when it hits the player (occasionally the collisions work, it's sporadic), which it should, and goes through the...
  9. C

    How to add a jump and gravity combined with tiles with game maker visual (DnD)??

    Here is a issue I have for all the DnD pros, I am new to this so please talk like you are talking to a child Here is how I have my movement and collisions so far for example here is my "Right key" and "UP" movement right movement UP MY PROBLEM: I have added gravity after the up button is...
  10. bandman28

    How do I change my Physics Fixtures?

    MODERATOR EDIT: This topic was messed up due to a mistake with moderation tools, and as such has been locked. The replies here refer to the following new topic: https://forum.gamemaker.io/index.php?threads/how-do-i-change-my-physics-fixtures.106530/ Please continue all conversation in that...
  11. J

    GML Visual How do I merge physics objects?

    I'm trying to combine 2 balls into a bigger one and I can't get them to merge. I tried putting a force (physics_apply_force) on them towards other.x,y but they like go to the side as well and aren't overlapping but hitting each other. I tried to change collision groups to their instance id so...
  12. J

    GML Visual What's a Fixture?

    (I've been using DND coding for about a year inconsistently so I'm not very good.) I'm testing out physics, it's a game when 2 of the same color balls collide, they combine and spawn a different bigger ball. When they collide, I'm changing their collision group from 1 to their instance id so...
  13. M

    Creating instances apart from each other

    Sorry if this is a really basic question, but I have an object that creates a random number of blocks in a grid with the following code: randomize(); blockcount = round(random_range(5, 8)); blocks = 0; grid = mp_grid_create(0,0, room_width/32, room_height/32, 32, 32); while (blocks <...
  14. pamelahoward

    GML Checking if space is free before moving?

    I have a top-down game. Player faces and moves toward mouse when "W"/Up Arrow is pressed. However I want to start adding in collisions, how would I intergrate checking for that? I assume using place_free somewhere, somehow. Not sure how to calculate the direction of the mouse as the target...
  15. S

    GML Visual Creating an effect at the point of collision between two moving objects

    I'm making a top-down pirate ship, cannon fire game with a player ship and enemy ships. At the point of writing, only the player fires cannonballs, but both player ship and enemy ships have health, and I'm trying to make ship-to-ship collisions work and look better. Up to this point, I've been...
  16. L

    (Solved) Collisionsss

    Soooo. I've been making a SideOn 2D platformer game recently and I have encountered a problem with collisions while using tilemaps. Now, I'm not an experienced coder myself, and because the tile maps I use are kind of big the built-in collision feature on Gamemaker is kind of a no-good for me. I...
  17. S

     Help refining wall collision

    Hello, I've seen many people use multiple strategies to tackle the issue of wall collision. In my case, I've used this code: var _collision = false; // horizontal collision going right if (sign(hspd) == 1) { if (tilemap_get_at_pixel(collisionMap, x+hspd+(4*sign(hspd)), y)) { x -= x mod 4...
  18. Z

    Automatic tile collision

    I am making a survival game (tile based) but i cant find any info about a automatic tile collision system that matches the requirements so here are the requirements and if you got any idea of where to search or know how to do it ill be very happy to hear Requirements: Must work with tiles that...
  19. P

    GameMaker [SOLVED]Collision not working for enemy npc

    Hello im doing a hack n slash game and my enemy npc collision is not working (yet my player collision is at they are the same code) Collisions on sprites are okay. code for collision NPC (not working): if place_meeting(x + x_speed, y, oWaterAndHole) || place_meeting(x + x_speed, y, oEnemy) {...
  20. M

    Car direction variable problem

    I have the following code for the movement of going fowards and backwards in a car: // Variables right = keyboard_check(vk_right) || keyboard_check(ord("D")); left = keyboard_check(vk_left) || keyboard_check(ord("A")); up = keyboard_check(vk_up) || keyboard_check(ord("W")); down =...
Top