Ok, what I have currently is a “Chess Board” type level, in which I can click each tile of the board to move my character. This all works fine. What I now need is some sort of path finding so that my character moves from tile to tile, rather than just making a straight line through everything to where I’ve asked it to move.
To better explain, imagine you’ve just started a game of Chess. You can’t move your knight, because a pawn stands in front of it. The problem I have is that if I select my knight, and attempt to move, my knight would just pass right through my pawn to wherever I’ve clicked. (I’m not making Chess this is just the best example I could think of to explain my problem without taking video)
My board has other “cubes” in the middle, but instead of going around them, my character clips right through them.
[x, x, x, x, x, x, x]
[x, x, x, x, x, x, x]
[x, o, o, \/, x, x, x]
[x, o, [], [], [], x, x]
[x, o, o, (), x, x, x]
[x, x, x, x, x, x, x]
[x, x, x, x, x, x, x]
Rather than the array’s path below. (The o’s represent the path taken, () represents my character, and the s represent an obstacle in the way)
[x, x, x, x, x, x, x]
[x, x, x, x, x, x, x]
[x, x, x, \/, x, x, x]
[x, x, [], [o], [], x, x]
[x, x, x, (), x, x, x]
[x, x, x, x, x, x, x]
[x, x, x, x, x, x, x]
I’ve taken a brief look at a tutorial on UnityGems I saw recommended to another user on A*, but as a beginner I found the tutorial out of my depth, or at least now explained in a way a beginner would understand. Does anyone know of a tutorial, or a something along the same lines, that could be helpful to me in my goal?