Rotate part randomly depending on vector normal

i have a blood script that uses raycasts to determine where a splatter is, and i’m trying to figure out how to make the splatter rotate in a random direction while still being aligned to the wall (like in jujutsu shenanigans)


i’ve looked around but i couldn’t find anything, mainly because i don’t know what to look for

Something like this?

local Position = RaycastResult.Position
local Normal = RaycastResult.Noraml
local FinalCFrame = CFrame.lookAt(Position, Position + Normal) * CFrame.Angles(0, 0, math.rad(math.random(-90, 90)))


Repo file:
ExamleForDevforum2.rbxm (3.6 KB)

2 Likes

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