#raycastparams.FilterDescendantsInstances not working

1 messages · Page 1 of 1 (latest)

copper nexus
#

I'm trying to raycast, but for some reason, raycastparams.FilterDescendantInstances isn't working and it's still stopping parts in the model.

    
    local params = RaycastParams.new()
    params.FilterType = Enum.RaycastFilterType.Exclude
    params.FilterDescendantsInstances = {player.Character, model}
    
    
    local result = workspace:Raycast(humanoidrootpart.Position, direction, params)```
copper nexus
#

someone pls help

magic monolith
#

u put mouse.hit on server thats what I see

#

and also I think u shoud use Print() to see if it hit smth, thats js some advice

wise schooner
copper nexus
#

THANK YOU

#

i found the problem

#

later in the script i was accidentally deleting a part in the model and not the model itself so it wasnt included in the filter anymore

copper nexus
copper nexus
blazing knot
#

depending on the seriousness of the logic i guess you can use:

#

local mousposition= userinputservice:getmouselocation()
local ray = workspace.currentcamera:viewpointtoray(mouseposition.X, mouseposition.Y)

#

and ray holds a table

#

u can use it like
workspace:raycast(ray.Origin, ray.Direction * range, raycastparam)

neat loomBOT
#

studio** You are now Level 1! **studio