start | Punto inicial. |
end | Punto final. |
layerMask | Un Layer mask que es utilizado para ignorar colliders selectivamente cuando se emita un rayo. |
queryTriggerInteraction | Especifica si esta consulta debería golpear Triggers. |
Retorna true si hay cualquier collider que intersecta la linea entre start
y end
.
using UnityEngine; using System.Collections;
public class ExampleClass : MonoBehaviour { public Transform target; void Update() { if (Physics.Linecast(transform.position, target.position)) { Debug.Log ("blocked"); } } }
start | Punto inicial. |
end | Punto final. |
layerMask | Un Layer mask que es utilizado para ignorar colliders selectivamente cuando se emita un rayo. |
queryTriggerInteraction | Especifica si esta consulta debería golpear Triggers. |
hitInfo | Si true se devuelve, hitInfo contendrá más información acerca de dónde el collider ha golpeado (See Also: RaycastHit). |
Retorna true si hay cualquier collider que intersecta la linea entre start
y end
.
If true is returned, hitInfo
will contain more information about where the collider was hit (See Also: RaycastHit).
Layer mask is used to selectively ignore colliders when casting a ray.