How to get the Layer Mask to feed into Physics2D.Raycast?

YakDogGames 3 years ago updated by Lazlo Bonin (Lead Developer) 3 years ago 2

Hi all,

New to bolt. I'm trying to detect the ground for my 2d Character controller and I need to use Raycast with a Layer Mask... Usually in code I would do:

int layerMask = 1 << LayerMask.NameToLayer("Ground");

So I can feed that shifted mask into the Raycast.

Any clue on how to do this in Bolt?

This is what I got currently:

Bolt Version:
Unity Version:
Scripting Backend:
.NET Version (API Compatibility Level):
I was using the wrong Units tho.

Using LayerMask directly fixed it.


Hi YakDogGames! Glad you figured it out :)