Raycast on a molotov only detects players?

i made a molotov which i couldnt finish cause the lack of my raycast knowledge but now im trying again and now it only detects players character

local exist = 30

local part = script.Parent
print(part)

wait(0.2)

local impact = false

while impact == false do
wait(0.05)

local raycastresult = Ray.new(script.Parent.Position,Vector3.new(0,part.Size.Y / 2 + .05,0 ))
local hit, hitpos = workspace:FindPartOnRayWithIgnoreList(raycastresult,{script.Parent})

if hit then
local DesiredCFrame = CFrame.new(hitpos, hitpos + CFrame.new(raycastresult.Origin, raycastresult.Direction).LookVector)
impact = true
print(“hitted”)
local cat = script.Parent.Explode:Clone()

  local fire = Instance.new("Part")
  cat.Parent = fire
  cat:Play()
  fire.Parent = game.Workspace
  game:GetService("Debris"):AddItem(fire,exist)
  fire.CanCollide = false
  fire.Transparency = 1
  fire.Anchored = true
  fire.CFrame = DesiredCFrame
  fire.Size = Vector3.new(10,2,10)
  local children = script.Parent:GetChildren()
  for i = 1,#children do
  	if children[i].ClassName == "ParticleEmitter" then
  		children[i].Parent = fire
  		children[i].Enabled = true
  	end
  end


  script.Parent:Destroy()

end
end

1 Like

no i mean it doesnt detect walls for some reason and only players even when its not even in the code???

Try setting up a normal raycast with the same parameters coming out of a static part and see if it returns the same data. If it detects parts and not just players, it may be something wrong with your model’s position or rotation.

what player is it detecting ru sure its not detecting the character as u throw it?