Making blood stick to a surface correctly

You can write your topic however you want, but you need to answer these questions:

  1. What do you want to achieve? Keep it simple and clear!
    I wanna make blood stick to a surface when the little droplets hits something

  2. What is the issue? Include screenshots / videos if possible!
    They don’t orientate with the surface, but to the orientation of the part

  3. What solutions have you tried so far? Did you look for solutions on the Developer Hub?

  • CFrame.lookat
    I’m not going to do raycasting unless it’s my only solution

After that, you should include more details if you have any. Try to make your topic as descriptive as possible, so that it’s easier for people to help you!

Blood Splatter Script

	local bloodsplatter = game.ReplicatedStorage.BloodSplatter:Clone()
	bloodsplatter.Parent = workspace
	bloodsplatter.Position = blood.Position +,.1,0)
	bloodsplatter.Orientation = hit.Orientation

Try using raycast:

local rayParams =
rayParams.FilterDescendantsInstances = {blood} -- filter so the ray ignores the blood descendants
rayParams.FilterType = Enum.RaycastFilterType.Exclude

local c c = game["Run Service"].Heartbeat:Connect(function()
	local results = workspace:Raycast(blood.Position,,-1,0), rayParams)
	-- checks if the ray hits anything
	if not results then return end
	-- hit then disconnect so it doesn't clone blood splatter indefinatly
	local bloodsplatter = game.ReplicatedStorage.BloodSplatter:Clone()
	bloodsplatter.CFrame = CFrame.lookAt(results.Position, results.Position + results.Normal) * CFrame.Angles(math.rad(-90),0,0)
	bloodsplatter.Parent = workspace
1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.