B
B
Bruh_Bruh2020-10-15 15:50:44
Unity
Bruh_Bruh, 2020-10-15 15:50:44

How to get the layer name through raycast?

How to find out the name of the layer in which the raycast falls in order to create a condition?
For example:

if (hit.collider.gameObject.CompareTag("Tag"))
{
//условие
}

But only instead of the object tag the name of its layer?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alex Maximovich, 2020-10-15
@Bruh_Bruh

https://docs.unity3d.com/ScriptReference/LayerMask...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question