How do you add in more than one layer mask to this script. I have tried many ways but I couldn't figure out.

For farther detail I want to add an enemy layermask to be the same as my collider layermask in the check colliders section.


using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class playerGridMovementScript : MonoBehaviour
{

public float moveSpeed = 2.5f;
public Transform movePoint;

public LayerMask colliderLayer;

// Start is called before the first frame update
void Start()
{
    movePoint.parent = null;
}

// Update is called once per frame
void Update()
{
    transform.position = Vector3.MoveTowards(transform.position, movePoint.position, moveSpeed * Time.deltaTime);

    //Checks if movePoint and player are together to make the movement
    if (Vector3.Distance(transform.position, movePoint.position) <= .05f)
    {
        // Left and Right Movement
        if (Mathf.Abs(Input.GetAxisRaw("Horizontal")) == 1f)
        {
            // Checks for colliders
            if (!Physics2D.OverlapCircle(movePoint.position + new Vector3(Input.GetAxisRaw("Horizontal"), 0f, 0f), 0.2f, colliderLayer))
            {
                movePoint.position += new Vector3(Input.GetAxisRaw("Horizontal"), 0f, 0f);
            }
        }

        // Up and Down Movement
        else if (Mathf.Abs(Input.GetAxisRaw("Vertical")) == 1f)
        {
            // Checks for colliders
            if (!Physics2D.OverlapCircle(movePoint.position + new Vector3(0f, Input.GetAxisRaw("Vertical"), 0f), 0.2f, colliderLayer))
            {
                movePoint.position += new Vector3(0f, Input.GetAxisRaw("Vertical"), 0f);
            }
        }
    }

}

}

See the “Combining layermasks” section in the accepted answer here: