I’m having trouble making a raycast from one part to another part. I’ve taken a look at some other people’s similar problems but none of their solutions seem to be working for me.
local params = RaycastParams.new()
params.FilterType = Enum.RaycastFilterType.Blacklist
params.FilterDescendantsInstances = {script.Parent}
local ray
local tries = 10
repeat
ray = game.Workspace:Raycast(script.Parent.Torso.Position, (playerr.Character.Head.Position - script.Parent.Chest.Position) * 100, params)
tries -= 1
until ray and ray.Instance.Parent == plr.Character or tries <= 0
if ray.Instance.Parent == plr.Character then
note that it is casting, just it only works from very short distances and hardly ever hits
This shouldn’t be necessary, FilterDescendantsInstances as its name suggests filters all of an instances descendants, for example FilterDescendantsInstances = {Character} would filter all of a character’s descendants.