Legacy Documentation: Version 5.1
LanguageEnglish
  • C#
  • JS

Script language

Select your preferred scripting language. All code snippets will be displayed in this language.

LayerMask.value

Switch to Manual
public var value: int;

Description

Converts a layer mask value to an integer value.

	// Casts a ray using the layer mask,
	// which can be modified in the inspector.

var mask : LayerMask = -1; function Update () { if (Physics.Raycast (transform.position, transform.forward, 100, mask.value)) { Debug.Log("Hit something"); } }