CircleCollider2D not picking up anything

two objects with collider 2d are not colliding.

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

public class Movement : MonoBehaviour
{
    public float speed = 10;
    public float y_moving = 0f;
    public float jump_power = 0f;
    public float gravity = 2f;
    CircleCollider2D colider;

    // Start is called before the first frame update
    void Start()
    {
        colider = gameObject.GetComponent<CircleCollider2D>();
    }

    // Update is called once per frame
    void Update()
    {
        bool isGrounded = colider.IsTouchingLayers(8);
        if (isGrounded) // if grounded
        {
            y_moving = gravity * Time.deltaTime;
        }
        if (Input.GetKey(KeyCode.Space) & isGrounded)
        {
            y_moving = jump_power;
        }
        y_moving -= gravity * Time.deltaTime;
        float x_moving = Input.GetAxisRaw("Horizontal");
        x_moving *= Time.deltaTime;
        x_moving *= speed;
        transform.position += new Vector3(x_moving, y_moving, 0);
        print(colider.IsTouchingLayers(LayerMask.GetMask("Ground")));
    }
}

Here is my code.

The last line never prints True, even if there are ground layers overlapping the colliders

Despite the myth, code doesn’t describe everything that you could be doing wrong. That said, there’s so much wrong here I don’t know where to start.

You don’t mention a Rigidbody2D which is troubling which means these colliders are Static (non-moving). Static don’t collide with other Static because it wouldn’t make sense right? I mean, they don’t move. Modifying the Transform isn’t something you should do with any 2D physics. Rigidbody2D move, Colliders are just attached to then.

“IsTouchingLayers” checks for contacts, it doesn’t go away and check if they’re touching there and then; there are other queries to do that. Contacts are calculated when the simulation runs which is, by default, during the FixedUpdate. You’re doing this stuff per-frame and it’s not clear but by the look of it, you seem to be modifying position then using that to see if they are touching. This is all wrong.

This isn’t a place for a tutorial on it as there are plenty of those online though.