Differentiating between CollisionLayers & blocks vs overlap

Godot Version

4.3

Question

I come from Unreal where there are channels which are the same as layers. However, in unreal you can set a channel to be blocking or overlapping and when you do line traces (raycasts) you can differentiate between these.

How do I do the same in Godot?

The information I’ve found so far doesn’t show how to handle if a Player wants to react to both walls which should block and other volumes on other layers which should let the player through but affect them somehow (ie send a signal on overlap probably, which seems to be a more targeted version of interfaces in Unreal)?

Masks would allow a player to walk through a wall, I guess I’ve always used trigger volumes which are similar to Area3D. For raycasts like seeing through glass but not walking through it, I would have a layer for transparent parts, the player can mask that layer, while the raycast does not

1 Like

Fantastic, thank you!

So, if I understand things correctly, there’s still no special trigger flag/layer in Godot (again Unreal actually has explicit trigger volumes built in as well), but rather you achieve that by putting the Area3D you suggest on a layer which the player does not collide with, but for the Area3D you make sure that its mask collides with the player and then send a signal?

Or is there another best practice when it comes to Godot?

Area3D does not block physics body collisions, so it’s always able to walk through. Sounds good, but I would need a real example to comment on mask/layer set up. As long as the Area has the player’s layer in it’s masks then the signal can fire.

1 Like

Thanks again, it sounds exactly like what I’m after! :+1:

(Now I see there’s 6 different types of layers in Godot even, so this will be interesting to setup.) :slight_smile:

The other layers do not have to do with collision at least. there are 2D and 3D collision layers, you will probably only use 3D for a 3D game. Good idea to name the physics layers in the project settings, I like to use Unreal’s default WorldStatic, WorldDynamic, etc.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.