#How to make a cone of raycasts from a humanoid for a detection system or is there a better way?

1 messages · Page 1 of 1 (latest)

stone burrow
#

I tried this so far

local PathFindingService = game:GetService("PathfindingService")
local Workspace = game:GetService("Workspace")
local Erig = Workspace.Enemy
local EHumanoid = Erig.Humanoid
local rayParams = RaycastParams.new()
local rayOrigin = Erig:GetPivot(CFrame.Position)
local rayDirection = Vector3.new(100, 100, 0)
local raycastResult = Workspace:Raycast(rayOrigin, rayDirection, rayParams)

print(raycastResult)
sharp fiber
#

Hold on, you want to detect if it's only the humanoid?

stone burrow
#

Yeah only if humanoids are in the ray

sharp fiber
#

rayParams.FilterType = EnumRaycastFilterType.Include
rayParams.FilterDescendantsInstances = {EHumanoid}

#

I guess

sage nebula