Developer knowledge network · moderated exchange

Супольнасць UnreliableCode

Супольнасць распрацоўшчыкаў даследаванняў, зваротнага праектавання і кадавання

Knowledge indexжыць
4Categories
919Threads
2.8KПаведамленні
Tutorial

Luau Raycast visualization & Wall-Check algorithms in 3D space

raycast_ryan
Ballistics Dev
MEMBER
прадстаўнік: 72
Дата далучэння: Sep 2019
Паведамленні: 32
Дзякуй: 16
3 тыдняў таму · Jul 29, 2026 11:51 PM
#1

To check if an enemy is behind a wall before triggering aimbot in Roblox:

LUA
local function IsVisible(targetHeadPos)
    local camera = workspace.CurrentCamera
    local origin = camera.CFrame.Position
    local direction = (targetHeadPos - origin)
    
    local raycastParams = RaycastParams.new()
    raycastParams.FilterDescendantsInstances = { game.Players.LocalPlayer.Character, camera }
    raycastParams.FilterType = RaycastFilterType.Exclude
    raycastParams.IgnoreWater = true
    
    local result = workspace:Raycast(origin, direction, raycastParams)
    if not result then return true end -- No obstacle hit, target is visible!
    
    -- Check if hit object is part of the enemy player character
    return result.Instance:IsDescendantOf(targetHeadPos.Parent)
end
luau_hacker
Luau Expert
MEMBER
прадстаўнік: 159
Дата далучэння: Aug 2020
Паведамленні: 17
Дзякуй: 26
3 тыдняў таму · Jul 30, 2026 2:18 AM
#2

RaycastParams.FilterType = RaycastFilterType.Exclude is the modern replacement for legacy RaycastFilterType.Blacklist. Fast and clean.

matrix_math_guy
Math Specialist
MEMBER
прадстаўнік: 105
Дата далучэння: Aug 2018
Паведамленні: 52
Дзякуй: 41
3 тыдняў таму · Jul 30, 2026 12:21 PM
#3

Eliminates shooting at targets hidden behind thick concrete walls.