MOST Grid Move

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.

Explosion Template uses MOST_GridMovement

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.

4-Directions Movement using MOST_GridMovement + MOST_Controller
8-Directions Movement using MOST_GridMovement + MOST_Controller
  • This System requires an Input Controller to receive commands (MOST Controller or any other input system)

  • All examples in MOST IN ONE use MOST Controller as the input source.

  • 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 the API.

API reference

// Next to each line shows the return and set data Type 

// Functions
// main behavior enables and disables the system
Most_GridMovement.EnableState(bool Enable);

__________________ Activate/Start __________________
// Start Moving function, call it to enable/start moving
// You can call it if the input doesn't provide direction yet
// example.. when touching the screen without moving the finger
// This method will move the object depending on its rotation
Most_GridMovement.OnInputDetected(); 

// Optional to call... you can just call OnInputUpdated() to start moving

__________________ Direction Update __________________
// Call it to update object direction // on controller direction updated
Most_GridMovement.OnInputUpdated(Vector2 direction);

__________________ On Stop Moving __________________
// the default value for exceed = false
Most_GridMovement.OnInputReleased([Optional] bool exceed);
// Call it to stop the object from moving // on controller release

//_______________________________________________________________//

// ReadOnly variable... Check if the Move system is active or not
Most_GridMovement.Enable; return bool

// ReadOnly variable... Quick check if the object is moving right now or not
Most_GridMovement.IsMoving; return bool

// Controls the moving part of the system, whether it enables (sends data) or not
Most_GridMovement.EnableMove; return or set bool

// Controls the rotation part of the system if it enables (sends data) or not
Most_GridMovement.EnableRotation; return or set bool

// the target direction of the movement system
Most_GridMovement.MoveAxis return or set (TargetAxis.X_Y or TargetAxis.X_Z) ;

// Grid size for MoveAxis
Most_GridMovement.GridSize; return or set float

// Movement Speed of the object
Most_GridMovement.Speed; return or set float

// Rotation speed of the object
Most_GridMovement.RotationSpeed; return or set float

Last updated