• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

GML [SOLVED] How to make an object not stop after a collision.

F

ForesterPL

Guest
Hi.
I have got two objects. Both are solid. Object 1 has got collision event. In collision event object 1 checks object's 2 speed. Object 2 stops after a collision. I want to make object 2 to not stop after collision with object 1.
How to do that?
 
Last edited by a moderator:
M

MishMash

Guest
You wouldn't believe how many years I went without understanding what solid did. The rather poor inconsistency is that solid actually moves a colliding instance back to the position it was in before the collision happened (when colliding via collision event). However, this often conflicts with what people WANT to use solid for which is functions like place_free(x, y), which arbitrarily check for collisions, but only against solid objects.

As a general note, the best practice you can use with any collisions in your game is to change it up so that you check if a location is free, say using place_meeting against a specific instance, and only move the character if that location is free, rather than trying to undo collisions. (This will also allow you to add smooth collisions by testing locations at slight off angles). In my opinion, the collision event should not be used for anything that objectively stops collision (like solid walls or floors), it should only be used for the sort of collisions that you want to detect, but dont stop motion, e.g. pickups, walking over spikes, interactions with things like pushable objects, collisions with enemies, etc;
 
F

ForesterPL

Guest
I never knew exactly what "Solid" was for. :D I unchecked it and everything works. Thanks!
 
Top