Move until collide?

I want it so that when I press Right Arrow Key on the red tile, it moves until it hits the green tile. All of the coloured tiles have box colliders on them with the tag of “Collide”

Your question is really vague. This screenshot doesn’t give a lot of context to how your scene is organized. For example, is there an underlying data model representing this grid? Do these tiles have scripts attached? Is the movement supposed to be instantaneous? Should it be smooth? Is it supposed to go one square at a time? Is the red tile supposed to stop BEFORE the green tile or ON it?

@PraetorBlue

Yeah fair enough I should have said more detail. Basically, the colour tiles are above the white ones, and I have just started the game so no code right now. I want the red tile to slide smoothly until it hits another collider. The collider is basically a square that encompasses all of the colour tile.

If you make the colored tile colliders extend above the board, you can use a CharacterController on the red tile: Unity - Manual: Character Controller component reference

CharacterController has built-in collision detection without relying on Rigidbody physics. Just make sure the radius is equal to half your square length. Then you can simply do something like this:

public CharacterController cc;
public float MovementSpeed = 1f;

void Update() {
  if (Input.GetKeyDown(KeyCode.RightArrow)) {
    cc.Move(Vector3.right * Time.deltaTime * MovementSpeed);
  }
}

Unfortunately CharacterController can only use a Capsule shaped collider for the character. So if you need to have a box shaped collider, you’ll have to back up and do your own raycasting for collision detection. Not sure if you need that depending on how your game actually works.