Version: 5.3 (switch to 5.4b)
IdiomaEnglish
  • C#
  • JS

Idioma de script

Selecciona tu lenguaje de programación favorito. Todos los fragmentos de código serán mostrados en este lenguaje.

RaycastHit

struct in UnityEngine

Cambiar al Manual

Descripción

Structure used to get information back from a raycast.

Variables

barycentricCoordinateLas coordenadas del baricentro del triángulo con el que chocamos.
colliderEl Collider que fue alcanzado.
distanceLa distancia desde el origen del rayo hasta el punto de impacto.
lightmapCoordThe uv lightmap coordinate at the impact point.
normalLa normal de la superficie contra la que impactó el rayo.
pointThe impact point in world space where the ray hit the collider.
rigidbodyThe Rigidbody of the collider that was hit. If the collider is not attached to a rigidbody then it is null.
textureCoordThe uv texture coordinate at the impact point.
textureCoord2The secondary uv texture coordinate at the impact point.
transformThe Transform of the rigidbody or collider that was hit.
triangleIndexThe index of the triangle that was hit.