#Making the rotation of blood random
1 messages · Page 1 of 1 (latest)
we dont need the whole code so heres the function that creats the splatter
local splatter = Instance.new("Part")
splatter.Name = "BloodSplatter"
splatter.Shape = Enum.PartType.Block
splatter.Size = SPLATTER_DIMENSIONS
splatter.Color = SPLATTER_COLOR
splatter.Material = Enum.Material.SmoothPlastic
splatter.Anchored = true
splatter.CanCollide = false
splatter.TopSurface = Enum.SurfaceType.Smooth
splatter.BottomSurface = Enum.SurfaceType.Smooth
local splatterPosition = impactPosition + impactNormal * (SPLATTER_DIMENSIONS.Y / 2)
local upVec = impactNormal
local rightVec
if math.abs(upVec:Dot(Vector3.yAxis)) < 0.95 then
rightVec = Vector3.yAxis:Cross(upVec).Unit
else
rightVec = Vector3.xAxis:Cross(upVec).Unit
end
local lookVec = upVec:Cross(rightVec).Unit
splatter.CFrame = CFrame.fromMatrix(splatterPosition, rightVec, upVec, lookVec)
splatter.Parent = Workspace
Debris:AddItem(splatter, SPLATTER_DURATION)
end ```