I’m currently working on a blood system and i’m trying to make it so the blood splatters attach to the cframe of the raycast, in its current state it can stick only to floors just not on anything that is angled.
Current RayCasting code:
local params = RaycastParams.new()
params.FilterType = Enum.RaycastFilterType.Blacklist
local t = {script.Parent, script.Parent.Parent}
params.FilterDescendantsInstances = t
local ray = workspace:Raycast(script.Parent.Position, Vector3.new(0,-1,0), params)
if ray then
if ray.Instance.Anchored == true and ray.Instance.CanCollide == true then
local s = game.ReplicatedStorage.BloodPuddle:Clone()
s.Parent = script.Parent.Parent
s.Color = script.Parent.Color
s.Position = ray.Position
script.Parent:Destroy()
end
end