How to prevent a collision from working on a certain sprite/object

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By dang_

Basically for my game, it currently involves an enemy character that moves continuously on its own and there are collision shapes on either side to stop the movement at a certain point and send it back so it continuously moves. the problem is that my player/character ends up hitting the collision and is unable to pass. Is there a solution to this??
(both player and enemy are kinematic bodys)

:bust_in_silhouette: Reply From: Bernard Cloutier

That’s what collision layers are for.

I’d suggest following the 2d tutorial, it covers a lot of the basics of a game: https://docs.godotengine.org/en/stable/getting_started/step_by_step/your_first_game.html#node-setup