0
Answered

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

YakDogGames 2 years ago updated by Lazlo Bonin (Lead Developer) 2 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:
Platform(s):
Scripting Backend:
.NET Version (API Compatibility Level):
I was using the wrong Units tho.

Using LayerMask directly fixed it.

Answered

Hi YakDogGames! Glad you figured it out :)

Cheers!