So basically I’m trying to make the blood like orientate on wall properly.
But for some reason the blood isn’t rotating properly.
I check other posts and tried to use their solutions but it still isn’t work. I’ve been trying to make it work for about 2 days. Also it only rotates properly for wedges.
here is the section where my touch logic is in.
(This is my first post so tell me if did something weird)
local db = false
bloodDrop.Touched:Connect(function(hit)
if not db then
db = true
if hit.Parent == character then
db = false
return
elseif hit.Name == bloodDrop.Name then
db = false
return
elseif hit and hit.Anchored == true then
db = true
bloodDrop.Anchored = true
local rayParams = RaycastParams.new()
rayParams.IgnoreWater = true
rayParams.FilterDescendantsInstances = {hit}
rayParams.FilterType = Enum.RaycastFilterType.Include
local raycastResult = workspace:Raycast(bloodDrop.Position + bloodDrop.Size, hit.Position, rayParams)
if raycastResult then
bloodDrop.CFrame = CFrame.new(raycastResult.Position, raycastResult.Position + raycastResult.Normal) * CFrame.Angles(math.rad(90),0,0)
end
bloodDrop:FindFirstChild("BloodSound"):Play()
local partTween = {}
partTween.Size = bloodDrop.Size + Vector3.new(math.random(2,2.5) - 0.25 , 0, math.random(2,2.5) - 0.25) - Vector3.new(0,.75,0)
local info = TweenInfo.new(0.7, Enum.EasingStyle.Sine)
local tween = TS:Create(bloodDrop, info, partTween)
tween:Play()
bloodDrop.CanCollide = false
bloodDrop.CanTouch = false
bloodDrop.CanQuery = false
end
else
print("blooddrop touched already")
end
end)