Help Raycast Model.PrimaryPart Not Working (World Position)

Output:

Unable to cast CoordinateFrame to Vector3

Code:

local params = RaycastParams.new()
						params.FilterDescendantsInstances = {
							v:GetDescendants()
						}
						
						params.FilterType = Enum.RaycastFilterType.Blacklist
						
						print(v.PrimaryPart.CFrame.UpVector * 100)
						
						local result = workspace:Raycast(v:GetPivot(), v:GetPivot() * 
                        CFrame.new(0,-100,0), params)
						
						
						if result then
							print(Ray.Instance)
						end
						

Raycasts only accepts vectors, you’re giving it CFrames

1 Like

Try using the cframe’s position instead of the cframe itself

local result = workspace:Raycast(v:GetPivot().Position, v:GetPivot().Position +
                        Vector3.new(0,-100,0), params)

not worked giving “nil” output