Movement Colliding Improperly In Two Directions
You can find my code here: https://pastebin.com/GfCEK3Pd
I'm trying to create a 2D isometric tile-based game. I've set up things properly, as far as I understand, in terms of tilemaps to display my sprites and tilemaps to provide collision.
I've got a yellow "cage" style tile cursor that has the linked script attached to it, providing it with movement.
In my HandleMove() method, I've got things laid out so that the player will move in one of four directions according to which WASD key they press. The movement itself works great when there's no collider geometry in the way, but when I try to move into collider geometry in two of the directions, I'm unable to get pressed up against the collider geometry like I can on the other two directions.
I have a simple 5x5 tilemap to test this on, where the pink/black sprites represent collider geometry. I'm able to reach this lower corner with the cursor:
But not this upper corner:
I'm not sure at all how to proceed here. I want to keep discrete, tile-based movement, and still be able to not smash through the bounds of my level.
Your answer
Follow this Question
Related Questions
[Unity 2D]Grid Based Character Movement Issues with Vector3D.movetowards 0 Answers
How to make gridbased movement while also using collision? 0 Answers
Help 2D attack 1 Answer
how to implement the reversal ,how to implement the reversal ... 0 Answers
How can I detect the color that the ball has collided with? 3 Answers