• Hey! Guest! The 40th (!!!) GMC Jam will take place between February 25th, 12:00 UTC to March 1st 12:00 UTC. Why not join in this very special anniversary jam! Click here to find out more!

GMS 2 [Solved]Need help. Collision with multiple objects in step event.



Okay so I can't seem to find a solution that works so I might as well give it a shot here.

Most of the code I used here is copied from some videos on youtube, and combined everything a bit to get the result I wanted.

I wanted to make a game where you smoothly could move up and down slopes. That all seemed to work out fine except there is now a problem with it: It only works with one object.
This means it will be difficult to add or remove blocks that would change up the game world (Think of a pitfall for example.)
I tried stuff like: place_meeting(x,y,o_solid and o_solid_2) but gmk2 doesn't really do it like that.

So this is how it looks now ^

These are the variables for my player. ^

And this is the step event for my player ^

I am now trying to do something with tile set collision so that I am able to replace the "o_solid" with the script that just lists all the objects that have to be solid. Here is my attempt at that.

This is the script (also gotten from a youtube video)^

And this is how I tried to implement it (not much success, it doesn't do much of anything. Also "solidTile" is just the name of the tileset in the room.)

TL;DR Made a collision system that works with slopes. Only works with one object, need help to find a (simple)way so it works with more than one object (or tileset, etc.)

I could post the youtube links after if that might help.
Or ask for any extra pictures if I forgot to show something important.

Hope someone can help me with this. Thanks for reading ^^


I seem to have solved it with just using parent and child stuff. Just child the parent to the "o_solid" (for examle) I had and the collision should work for both objects.