soundgnome
What lines of code would I need?
I read all of the doc, yet it only mentioned the properties, not how to utilize them.
I tried tweaking the code provided in the doc, but I couldn't formulate a way to detect a collision layer.

func _physics_process(delta):
    var collision_info = move_and_collide(velocity * delta)
    if collision_info:
        var collision_point = collision_info.position

How would I modify this code to make it detect when I collide with a specific layer.
Is there anything else I should be trying?

    Vickyboi You can call get_collider on collision_info and then check the collision_layer of the returned object. Something like:

        var collision_info = move_and_collide(velocity * delta)
        if collision_info:
            var collider = collision_info.get_collider()
            collider.collision_layer # etc

      soundgnome
      It may be important to mention that I am trying to collide with tilemaps
      I tried to print the print(collider.collision_layer), but it returned: Invalid get index 'collision_layer' (on base: 'TileMap').

        soundgnome
        Thanks! This video has revealed some very important details to solve the problem.
        However, I cannot find how to grab the layer number in a 2d platformer setting, even after some heavy research.
        I may have to utilize a different approach for interacting with tilemaps, any suggestions?

          Vickyboi So in that video he used custom data layers (rather than collision layers) to flag tiles to trigger specific interactions, he shows how to set it up starting at around 2:10.

          @"soundgnome"#p11092

          Would this approach work in a 2d side scrolling platformer?
          I think I can do it now (hopefully). Just to clarify, I wouldn't need ALL of the code in the terrain detector, just the ones he shows?

          14 days later

          soundgnome
          I finally did it! Thank you for sticking with me through this process, I'm sorry for how annoying it might've been. I can finally continue my game!

            Vickyboi Glad you got it worked out! And no need to apologize, I just didn't see your previous reply (looks like something went weird with the "@" and I didn't get a notification).

            6 months later

            That video is great, but I still need to get the collision layer, not custom data, so the vid doesn't really solve the problem

            a year later