How to restrict objects movement to specific position coordinates
Currently my player object starts by moving directly upwards until user swipes in a specific direction in which case the player moves in that swiped direction until another swipe is done by the user. I have all the scripts for this working thus far but I am attempting to lock the player movement to a grid per say where the swipe right will only move to the right if the swipe was done within a certain tolerance of the position it can move within. The best way I can explain it is to make sure there is smooth transition within a maze where it cant get stuck on corners etc. Any insight as to where I should go from here would be helpful. Thank you.
Your answer
![](https://koobas.hobune.stream/wayback/20220612133652im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Grid Movement with Smooth Movement 0 Answers
Creating a maze within a grid 0 Answers
Grid movement with a rectangular grid? 1 Answer
Hexagonal Grid Rangefinding 1 Answer
The object moves more that what I want (MoveTowards) 0 Answers