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.