# Checking for something touching at the [x direction] of an object

• So I want to check 'if there is an object to the left, right, up, or down of my object'. I tried 'collided' but i don't know how to do 'if colliding with nothing'. I'm basically trying to set my object to a specific graphic if there is another object to the left of my selected object. Any help would be appreciated. Keep in mind I can't use specific object as I'm planning for an in-game level editor that hopefully you can save your levels, either online or offline.

if you check my replies I provided images of what I tried to explain

• @iKatKing10362 do you want it to be touching it on the left or just anywhere left of it?

• Sounds like a fun logic problem.

Let's think about what "to the right?" actually means. If you have an object A on an x-y plane and you want to see if another object B is to the right of that object, you are actually asking if the x-posiition of object B is greater than the x-position of object A. If it is, then object B is to the right of object A.

You can put copies of object B into a tag and check if the x-position of any item in that tag is greater than the x-position of object A. This may work.

• @TutorialDoctor I can't use individual objects. I forgot to mention it is going to be a level editor, let me show an image of what I mean:
As you can see when in the level editor( when implemented) someone previews their level, I want the blocks to automatically change sprites to the edges and such.
Hope this helps.

• Also it would be nice if someone could explain multiple connections, like the following image to me.

It will help making the normal none-player-designed levels easier to craft too

• @iKatKing10362 you could use @mc-games's grid example and then keep track of which places have an object. Then an object can just check and see if the spot next to it is taken, and if it is, set the graphic to whatever.