How to make a kinematicbody not collide with staticbody?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By ismaelgame7
:warning: Old Version Published before Godot 3 was released.

Hello people,

I’m using the Godot 2.1.4…
I have a project under development and wanted to know how to make a kinematicbody not collide with just a staticbody?

Can someone help me? please!? :slight_smile:

:bust_in_silhouette: Reply From: Aaron

That is what layers and masks are for.

Collision layers and masks

Collision bodies, such as your KinematicBody and your StaticBody, may be in one or more layers determined by the Layers property and set what layers they look in for colliders with the Mask property. Body A detects a collision with Body B if B is in a layer that’s set in A’s mask.

To make your KinematicBody pass through your StaticBody you’d set their layers and masks to make sure none of the StaticBody’s layers match the KinematicBody’s mask and none of the KinematicBody’s layers match the StaticBody’s mask.

This question is about the difference between layers and masks.

Many thanks Aaron, gave to understand how it works!! ^^

ismaelgame7 | 2017-12-07 14:24