How to implent movement AROUND grid
Hello, Everyone seems to be asking about how to implemnt gridbased movement, where you move form tile to tile. I on the other hand, need to find a way to move on the edges of the grid only (around the tiles). How do I do that? I was thinking about adding colliders to the tiles so the character can only move between the tiles, but it seems like an odd option to me.
Answer by NoseKills · Aug 30, 2016 at 05:07 PM
Based on the information you give i would say this is completely a presentation problem.
The movement is exactly the same in both cases. The only thing that changes is how the visible grid is positioned in relation to whatever is moving.
Put a chess piece in the middle of a square. If you move it the length of one square you will always land int he middle of another square.
Do the same but put the piece in the intersection of 4 tiles and do the same and you'll always land in another intersection
If your game mechanics allow you to get by using only a grid, the benefit is exactly the fact that you don't need to fiddle around with physics and sacrifice the performance for it or deal with randomness in movement and positioning.
But you shouldn't be able to teleport from one side of the grid to the other. The only movement allowed is along the lines. imagine the tiles being big mountains, and you have to walk around the mountain.
I converted your answer to a comment since I don't think you meant it to be an answer.
This is a requirement that could be placed on either of the examples I mentioned.(being able/not being able to move multiple tiles at a time).
I'm getting the feeling there's an information gap here. $$anonymous$$aybe an image could give us a better picture of how the system should be different from a normal grid system (with possibly blocked tiles)
If you imagine a mountain in the center of each square on a chess board, my chessboard example still applies. If you start from a 4 square intersection (a valley) and always move the length of 1 square, you will never end up on top of a mountain.