collision

  1. H

    Collision issue when using cursor to change image angle

    I am trying to make a top down shooter where my character is facing in the direction of the cursor. I coded in movement and added a collision event for the character and the wall object. However, the player is able to collide with a wall then face the character in a way that its hitbox...
  2. GLITCHGOO

    GMS 2 Various questions

    1. How do you detect if an instance is touching another instance? 2. How do hitboxes work? im more used to having 4 seperate hitboxes each detecting which is touching which, but if theres an easier way im all ears! 3. How do you "shrink" a sprite? (i.e. a pixel art sprite and a normal art sprite...
  3. DrScoop

    SOLVED Cropping an objects sprite with code

    Hello there, Im attempting to add a mini game to my game like a tower stacking game. In this game, we have a block the player drops which the player has to try their best align properly with blocks already dropped. So, when a player drops the block on another, if the block misses being aligned...
  4. Mehdi

    SOLVED point_in_line?

    Hello, Does anyone know how to write a script that checks whether a point is in collision with a line? GM has the function collision_line, but that one looks for an object in contact with a line. Whereas, the thing I want is checking the line against a point. Furthermore, there are functions ...
  5. K

    Undefined variable trouble in collision scripts

    I'm having trouble with my collision scripts for my project (a sonic like game for those wondering) and i keep getting these error stating that there is an undefined value in the scripts. this is an example of what is in the function of one of my collsion scripts mask = argument0; radius =...
  6. Mehdi

    How can I do this?

    Hi friends and merry Christmas to all. Does anyone know how one could make such terrain? (Dark areas) Only a few points: This is non-physics, therefore box2d terrain generation is not needed. The terrain is not procedural, because the game is played in preset levels. The terrain is smooth &...
  7. jpegsunshine

    SOLVED Player hits a Wall object from below and pummels down, getting stuck

    Hi. I've been trying to find out why this happens. I'm starting a basic platformer game as practice. So far I have two objects with their respective sprites (both with their origin in the middle centre): an oPlayer and oWall. I've mostly followed Shaun Spalding's tutorials on platformer...
  8. kamiyasi

    GMS 2.3+ Issue with my precise tile collision checking

    Hello. I created a script for tile collision checking for my player object, but I have an issue that I haven't been able to figure out a solution for. Right now, it works great, except that I need to add logic for a collision shape for the player. Currently, my code acts like the player's...
  9. R

    GMS 2.3+ Crashing when colliding

    Sometimes the car enters the object and gets stuck. How to make the car not enter solid objects in all collisions? See Attach file! // collision if place_meeting(x, y, Casa) || place_meeting(x, y, Casaa) || place_meeting(x, y, Casab) || place_meeting(x, y, Forest) || place_meeting(x, y...
  10. KyleRansford

    GMS 2.3+ Transparency Not Working Correctly With Trigger

    I'm wanting to create a transparency effect when the player walks under a tree, so that the alpha fades to 0, then after the player leaves, the alpha goes back to 1. This is the code I've been trying out, but it only works without the else if statement. if place_meeting(x, y, o_trigger) {...
  11. JeanSwamp

    GMS 2.3+ Object Collision while moving them with mouse

    Hello, I am trying to add collisions to objects with eachother, while dragging them with the mouse. I am currently working on some room decoration project, where you drag and drop objects to an empty room with your mouse. I want to make sure you cannot overlap items with eachother, and I am...
  12. B

    DnD simple horizontal or vertical bounce

    Hi there, I am a teacher and have not managed to find a very simple solution to this problem for my students using drag and drop code. I would like to make an enemy sprite that simply bounces back and forth of a wall. This code should be something as simple as (I will write in GML for...
  13. N

    GMS 2.3+ Precisely how is place_meeting calculated?

    Hi! I will admit I haven't looked intensely, but after a little google searching, I can't seem to find a detailed description of how place_meeting is calculated. My guess is that for non-precise collisions it's checking if any two adjacent sides of caller's bbox and collision objects bbox are...
  14. B

    Having trouble understanding why my collision code doesn't work properly

    I'm attempting to make a platformer game. So far, I have the horizontal movement where I would like it to be; however... I'm having trouble implementing code that properly detects collision. When I move my box, it will stop ever-so briefly before sidling up against the edge. Additionally...
  15. Z

    GMS 2.3+ Collision - Object getting teleported

    Hi guys, I have some troubles on my collision system. I took it from Shaun Spalding tutorial () Here is the bug : When an ennemy is stuck in a wall (not really stuck, just moving towards the wall but he can't go further), sometimes it might teleport himself to the next wall when he changes...
  16. T

    Mac OSX Collision events giving false positive between ball and brick

    Hey everyone, I'm currently on some of the later stages of a personal project I'm working on - creating a variation of the Brick and Ball "Breakthrough" game. I have 95% of the core mechanics worked out with my sprites and collision masks, but am having some strange behaviour when the ball gets...
  17. L

    GMS 2.3+ SOLVED - Randomly generated objects have no collision

    Hey, In my game I have these enemy's that have this simple ai grid pathfinding that I used from this itch.io page. https://randatabase.itch.io/simple-ai-grid-pathfinding It does what it's supposed to do but I have a little problem. I have this system where is randomly spawns a certain amount...
  18. OKOCIM

    GMS 2.3+ Max number of collision events per object?

    https://forum.yoyogames.com/index.php?threads/adding-a-new-object-with-any-parent-crashes-game.90054/#post-540036 Above thread shows full context - I performed a rollback but the issue eventually returned. The game crashes with non-zero error upon loading level (after the menu/config room)...
  19. Z

    GML How to stop object from glitching through walls

    Hello there, I have a top down game where you can move objects around by bumping on them. Now to prevent them from moving into walls or blocks I've made a Step Event This is the code // STEP // var wall = instance_place(x,y,obj_block); if wall != noone { var wd =...
  20. W

    Multiple Bounding Boxes Example And Feedback Please

    Not sure If this the the best place to put this but I wanted to share and maybe get feedback on my multiple bounding box collision code. Here is picture with two bounding boxes. I use the blue one to detect collision (top or bottom) with tiles to set character depth accordingly (To be in front...
Top