How to make bandage align with bullet wound

Hello.

I don’t know if I’m blanking out right now or what. But, I want to make it so when a bandage is applied, it actually covers the given bullet wound. I have the dressing, defined as Dressing and the bleed, defined as Bleed. Bleed’s parent is the arm and that can be used to help align - I think. I want the bandage to have the same CFrame as the arm, but be aligned with the bullet wound. Is there anyway to do this? Anything helps!

script.Apply.OnServerEvent:Connect(function(Player, Bleed)
	local Dressing = game.ReplicatedStorage.MedicalEvents.MedicalStorage.Attachables.Dressing:Clone()
	Dressing.Parent = Bleed.Parent
	
	Dressing.CFrame = CFrame.new(Bleed.Parent.CFrame)
	
	local WeldConstraint = Instance.new("WeldConstraint", Dressing)
	WeldConstraint.Part0 = Bleed.Parent
	WeldConstraint.Part1 = Dressing
end)
1 Like

I’m assuming that you want the position to be at the bullet wound but the orientation with the arm. Then I guess I’ll do this:

script.Apply.OnServerEvent:Connect(function(Player, Bleed)
	local Dressing = game.ReplicatedStorage.MedicalEvents.MedicalStorage.Attachables.Dressing:Clone()
	Dressing.Parent = Bleed.Parent
	
	local Arm = --// Your code here depending on which arm you want
	Dressing.CFrame = CFrame.lookAt(Bleed.Parent.Position, Bleed.Parent.Position + Arm.CFrame.lookVector)
	
	local WeldConstraint = Instance.new("WeldConstraint", Dressing)
	WeldConstraint.Part0 = Bleed.Parent
	WeldConstraint.Part1 = Dressing
end)

If the orientation is like 90 degrees off or something like that (because I don’t know the default orientation of your bandage), you can multiply the CFrame by an angle like this:

Dressing.CFrame = CFrame.lookAt(Bleed.Parent.Position, Bleed.Parent.Position + Arm.CFrame.lookVector) * CFrame.Angles(0, math.rad(90), 0)

Adjust the number for the angle and/or the axis of the angle until you get what you want. Hope this helps.