collision

  1. Caio_Mendes

    Enemy attack not working

    I want to make as that when my enemy attack, when it hits frame 8 and above, and it hits the player, it resets the game (or do damage, whatever). I already tried with a code that works well with another enemy of mine, but in this one it doesn't, i don't know why //here's the code if...
  2. Caio_Mendes

    How to make a solid object not collide with a specific collision?

    Let's see my problem here. I have my object for the player, and i have my object for the enemy. My player is a solid object, for obvious reasons (want to make him collide with collisions). When the player gets into a certain distance of the enemy, the enemy executes its attack animation, using...
  3. O

    GameMaker Code equal to collision event. Place meeting or instance place gives different results

    I would like a command identical to the collision event in the step both place_meeting and instance_place by default generate different results than the collision event. I would need this code to optimize the game
  4. M

    GML Trying to get collisions to work

    I'm pretty much a GML noob and I'm trying to do a top down game. I can't find anything that makes collision to work without my player getting into the walls. My movement line of code is pretty much this: movh=-keyboard_check(ord("A"))+keyboard_check(ord("D")) if movh!=0 { if movh>0 and...
  5. M

    GameMaker I think I don't understand "instance_place_list"...

    So I was making a game where good objects and bad objects spawn at the top of the room and fall to the bottom of the room. You are a bag and you need to catch the good things and let the bad things fall to the bottom of the room (and then the bad things disappear), but sometimes the bad thing...
  6. Staral

    Help with player not being able to move as close to a wall as possible

    Hello, I have gotten very hung over on a minor inconvenience in my game that is walls. My game is top down and I'd like for when you hug up against a wall your character is able to get as close to the wall as possible, the player is often off the pixel grid (their x and y aren't whole numbers)...
  7. T

    GML Visual "If Collision Point" not working as intended. [SOLVED.]

    I'm trying to get my character's health to go down when she runs into an enemy object. I've tried several different ways using the collision functions on GML Visual. What I currently have. I'll provide more context if needed, but I have a feeling it's gonna be something really stupid I missed...
  8. 4

    GameMaker Overlapping objects both respond, even though only the topmost one should

    Hello everyone! I'm a complete beginner with Game Maker and I've encountered my first problem. I have two objects that partially overlap each other. I want that whenever the mouse pointer is over an object, it moves a few pixels up, and when the mouse pointer leaves it, it goes back to its...
  9. S

    place_meeting activating when it shouldn't be.

    I am quite new and I am just trying to code basic collision and movement, but for some reason place_meeting which is what I use for collision seems to be activating randomly. Here Is my code in step: //taking inputs keyRight = keyboard_check(ord("D")); keyLeft = -keyboard_check(ord("A"))...
  10. Ato

    Player Sprite Not Colliding With Ground in Platformer

    Hey everyone, I am new to GameMaker Studio, and started working on a platformer game yesterday, following along with a 6 year-old YouTube tutorial. I can move my character (green square) horizontally, but my character seems to be unable to make contact with the platforms I created, so when I...
  11. D

    GML Weird behavior with "place_meeting" function

    Apparently, after the new "Collision Compatibility Mode" option, GameMaker's default collisions shouldn't be rounded and are "inclusive" (according to the manual). The problem is that even with the new collision system, values seems to be rounded and collisions won't be detected with less than a...
  12. K

    GameMaker Problem with collision when player attack

    So, I'm using this code to detect whenever the player hit an enemy or entity with the attack animation and for that I'm using a precise collision mask and using mask_index to change the mask when the player use the attack animation. function playerAttack(){ var entityOnHitbox =...
  13. M

    Collision problem

    I am making an 8-directional character movement. I am using the following code: rightKey = keyboard_check(vk_right); leftKey = keyboard_check(vk_left); upKey = keyboard_check(vk_up); downKey = keyboard_check(vk_down); xspd = (rightKey - leftKey) * spd; yspd = (downKey - upKey) * spd; if...
  14. anima

    SOLVED bullet collision issue

    Hi. So i am triying to make a top-down tank game and each tank has seperate hitboxes for each side(frontal,side and rear),the problem is that if i try to shoot the tank`s rear the shot just goes through both the rear and side hitboxes and only hits the front i have tried to use collision_line...
  15. N

    GameMaker Why does game maker not have collision events for Tile Layers?

    Hi All Gamemaker allows you to create a collision event when an object collides with a different type of object. However, there does not seem to be any event equivalent for tiles (and hence I have to write my own logic for tile collisions). Does anyone know why this is the case? I am...
  16. R

    [SOLVED]Character stuck to edge at launch - Collision

    Hi people, first time dipping into GML, following Shaun's 2020 tutorials. I strictly followed his instructions but my character starts stuck in a 1pixel wide corridor on the left edge of the window, only allowing me to move up and down. I place my object anywhere in the room, but always start in...
  17. thejosving

    GameMaker Is there a way to discover the exact point where the collision happened?

    As the title says, is there any way for me to find the point, in pixels, where one object "touched" the other?
  18. Tete-chin

    GameMaker GML Visual Examples for Beginners (movement, collisions, etc.)

    GM Version: v2023.2.1.75 Target Platform: ALL Download: No download Links: N/A Warning: The audio is in Spanish but you can activate the captions with translation. It translates well. Select closed captions (cc) tool, then select settings / auto-generate / language choice. First lesson: How...
  19. M

    How do you update a variable only once when two objects collide?

    Hopefully someone can help me. I get a problem when I try to update a variable when two objects collide. The integer variable just keeps on getting bigger because the two objects are continuously colliding as they pass through one another. Is there and easy way to stop this, without removing...
  20. CardinalCoder64

    GML Guide to Basic Slopes Using Linear Math and Geometry (Object-Oriented, Top-Down)

    GM Version: 2022.1+ Target Platform: All Download: N/A Links: Basic Slopes + PPOBC* Projects (GitHub) *Pixel-Perfect Object-Based Collision. Learn more. Summary: In this guide, you will learn how to implement basic object-oriented slopes in a 2D top-down game* using linear math/equations and...
Top