[Solved] Problem with Isometric Grid / Snapping

Hello Devs,

i got a math problem with an isometric grid. I got an object “Platzieren” wich is snapping to the mouse cursor in a specific grid: Width:100 Height: 57

Then i got another object “Beginning” wich is also snapped to this grid but solid on the map.

Now i want, if a special action happens (Left Mouse Button pressed) that the object “Platzierbar” is snapping to the grid and snapping to the mouse cursor from the Position of the object “Beginning”.

Basically it should snap on the blue line i drew on the screenshot but also snap to the grid.(This is for the graphic that the tiles match together) I tried to work with the code from screenshot one but i just cant figure it out. Probably the solution is too esay and i just dont get it. :slight_smile:

Sorry for the bad english, if u need mor clarification for my problem feel free to ask me. Thank you in advance. ~ MrKittixon

When you say “snap on the blue line”, you want the piece to slide along that line only, and snap to a grid at the same time?
Using cell width as you did should be okay, but for cell height, you need to figure out the equation of how Y relates to X… should be 57% of X, right?
My math is quite rusty, I’m afraid :sweat_smile:

Hey Gruk,

thank you for your response. I tried ur idea but its kinda messing around with my “isometric snapping machine” .I found a solution its not the best but it should work for now. :slight_smile:

Nevertheless thank you for ur effort. ~ MrKittixon

1 Like