A Control system for grid movement (square step movement) with all possible properties of the grid movement like 8-directions movement, speed, obstacles detection, direction correction system, stop point snap, animation control, camera following system (with rotation correction), and much more.
The system can detect obstacles (layer mask can be controlled) so the character stops when it is blocked by another object.
also, it comes with a Direction corrector system that makes the character correct its movement direction when the input direction is blocked by obstacles.
Note:
This System requires an Input Controller to receive commands (MOST Controller or any other input system) and all examples in MOST IN ONE use MOST Controller.
it's much better this way to be easier to modify and if you want to use another Input system instead of MOST Controller.
you will find the "Input Getter" section inside the .cs file contains all functions that receive input commands for this system, Check API.
API
// All attributes are set and get so you can modify or call// Next to each line shows the return and set data Type // Functions// main behavior enable and disable controllerMost_GridMovement.EnableState(bool Enable);__________________ On Start Moving __________________// Start Moving function, call it to enable/start movingMost_GridMovement.OnInputDetected() // you can call it if the input doesn't provide direction yet // Like.. when touch screen without moving the finger // This method will move the object depending on its rotation// Optional to call... you can just call OnInputUpdated() to start moving__________________ On Direction Update __________________// Call it to update object direction // on controller direction updatedMost_GridMovement.OnInputUpdated(Vector2 direction)__________________ On Stop Moving __________________// the default value for exceed = falseMost_GridMovement.OnInputReleased([Optional] bool exceed)// Call it to stop object from moving // on controller release//_______________________________________________________________//// ReadOnly variable... Check if the Move system is active or notMost_GridMovement.Enable; returnbool// ReadOnly variable... Quick checker if the object is moving right now or notMost_GridMovement.IsMoving; returnbool// Controls the moving part of the system if it enables (sends data) or notMost_GridMovement.EnableMove; return or set bool// Controls the rotation part of the system if it enables (sends data) or notMost_GridMovement.EnableRotation; return or set bool// the target direction of the movement systemMost_GridMovement.MoveAxis return or set (TargetAxis.X_Y or TargetAxis.X_Z) ;// Grid size for MoveAxisMost_GridMovement.GridSize; return or set float// Movement Speed of the objectMost_GridMovement.Speed; return or set float// Rotation speed of the objectMost_GridMovement.RotationSpeed; return or set float