Collisions on a specific edge

How do i check if the same instance of a object collides with a specific edge of that instance.

you could add points to each corner of the instance:

And use this instead:

what this does is detects whether those specific points on the corners of the subject object is inside the collision mask for the collided object (object2)

1 Like

The thing is the object don’t collide, its just the edges that do so, will this still work?

what i shown before will not make collision physics, but just detect whether the corners are inside another object’s collision mask.

Are you meaning to only have collision physics on a corner of an object?

so first of all, its edges i want to check, and what i mean by that is that, if another instance of the object collides with the objects edge then a action will occur.

alright, then this should do the trick :wink:

But, have a 1 pixel smaller (on each corner) collision mask for the object
thiis is the simplist yet untested possible solution i can think of. sorry i cannot test this myself at the moment so let me know if it works

dosen’t seem to work, but dosen’t the point have to collide the the collision mask for it to count as a collision? Thanks for taking your time.

Also forgot to mention that, if i resize the collision mask by 1 pixel that would make the character collide with the block (not counting edges) which is something i don’t want.

Ah, I understand.

I can think of a complicated solution. I just did not want to for simplicity sake, but if you would like me to share it with you, I can

Yes please, would be very helpful, maybe you should also know im using this for a specific tile system, if you want me to send a screenshot i could do that, maybe there is a easier solution than checking edge collisions.

1 Like

I have made my more complicated solution!
Here is the quick template project I made, feel free to take from it and tweak as you will.
For testing it yourself, press preview on that project and use WASD to move selected block around, Q and E to rotate the block selected, and SPACE to change which block is selected

When an object collides with it’s edge it turns opaque. The hitbox is needed to be tweaked by you and you can in the ObjectCollision object

ps… this works with tiles too

Thanks alot for trying to help me, although i didn’t quite understand what the example is showing me, maybe it would be better for me to show what im trying to acomplish and then you’ll know how to setup the example. Thanks again