Answers for "get layermask from gameobject layer unity"

C#
2

get layermask from gameobject layer unity

LayerMask.GetMask(gameObject.layer);
Posted by: Guest on July-21-2021
0

layermask in unity

}    void FixedUpdate()
    {
        Transform transform = Camera.main.transform;        if (Input.GetKeyUp("space"))
        {
            // Check for a Wall.
            LayerMask mask = LayerMask.GetMask("Wall");            // Check if a Wall is hit.
            if (Physics.Raycast(transform.position, transform.forward, 20.0f, mask))
            {
                Debug.Log("Fired and hit a wall");
            }
        }
    }
}
Posted by: Guest on May-22-2021
0

get gameobject layermask

gameObject.layer;
Posted by: Guest on July-21-2021
-1

unity get layermask

int layer = (int)Mathf.Log(uninteractablePartsLayer.value, 2);
Debug.Log("uninteractablePartsLayer "+LayerMask.LayerToName(layer));
Posted by: Guest on December-09-2020

Code answers related to "get layermask from gameobject layer unity"

C# Answers by Framework

Browse Popular Code Answers by Language