Screen Multi-Raycast

Camera
Client Side
Both Mobile and PC

Perform ray detection through screen touch and return all hit entities

Declaration

func ScreenMultiRaycast(startPosition Vector2, distance float, layerMask List<int>, includeTrigger bool, out var hitEntities List<entity<Entity>>, out var hitPoints List<Vector3>, out var hitDistances List<float>, out var hitNormals List<Vector3>)
go

Parameters

Input

Name Type Description
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

Out

Name Type Description
Hit Entities ListT_Entity List of entities hit
Hit Points ListT_Vector3 Hit point coordinate list
Hit Distances ListT_Float List of distances between the hit point and the start point
Hit Normals ListT_Vector3 List of hit surface normals