Hello everyone,
I'm working on a grid based movement system for a game.
Currently I'm using iTween actions (moveBy) to move the character left,right, forward and back. This may become a problem later on as I wish to have pushable blocks, but we'll cross that bridge when we reach it.
I currently have two problems that I'm a bit stumped by:
a) using the iTween actions seems to ignore colliders, so tiles that are raised up as walls do absolutely nothing to stop the player from moving inside of them.
b) due to the 3d nature of the game, and level designs, it is possible for the character to step off of the platforms (which is intended) and land on another tile off-center (which is not intended). Ideally the player should always sit in the center of the tile that it is standing on.
So I guess in a roundabout way I'm asking what would be the best system for this sort of 3d grid-based movement, or how I could specifically address these two problems.
I haven't the foggiest idea how to tackle a). I thought maybe of having 4 colliders on each polar direction, and if a collider was overlapping a wall disallowing movement in that direction.
For b) I was thinking about raycasting below the player after an event that would set the character off-center, testing for the platform below the player, comparing the X/Z of the player and the platform and then transitioning the player to the platform's X/Z.
Any help would be much appreciated, I shall keep trial and erroring in the meantime.
Thanks in advance.