Is there way to check if place is free and if not get id?

I’m making True Tile Collision physics and it’s working great, but for platformer games, I need solution for moving platforms. I have several collision solutions in my head, but I’m wondering if there is already such a solution in Defold.
Basically, I need to check the next position if it’s free from platform object if it’s not, then get the ID of the platform to read variables stored in it (example: x&y position, width & height).
My goal is to not use built-in physics that do the job for me (triggering collision is ok I guess). But I’m worried about Defold messaging system to give a late response and character falls inside the platform for one frame before I can snap it to the top of the platform.
For example in Gamemaker there are several options:
Check the position if the object were moved there and return true/false;
Check the position if the object were moved there and return id/noone(-4);
Check the position of one pixel and return true/false;
Check the position of one pixel and return id/noone(-4);

2 Likes

Can’t you do this using synchronous raycasts?

1 Like

Although the documentation doesn’t mention it, it should return 0 if no tile was found on the coordinate.

I have tiles working great but I think moving platforms should be objects.

Got to check raycasts. Thanks for the idea.