Screen Single Raycast

Camera
Lado del cliente
Disponible en PC y móvil

Perform ray detection through screen touch and return the first entity hit

Declaración

func ScreenSingleRaycast(startPosition Vector2, distance float, layerMask List<int>, includeTrigger bool, out var hitEntity entity<Entity>, out var hitPosition Vector3, out var hitDistance float, out var hitNormal Vector3)
go

Parámetros

Entrada

Nombre Tipo Descripción
Start Position Vector2 Start screen touch point
Distance Float Detection distance
Layer Mask ListT_Int Layer mask, only the filled layers will participate in the scan, leaving it blank means all layers will participate in the scan
Include Trigger Bool Whether the trigger can be detected

Afuera

Nombre Tipo Descripción
Hit Entity Entity Entity hit
Hit Position Vector3 Hit point coordinate
Hit Distance Float Distance from hit point to start point
Hit Normal Vector3 Hit Surface Normal