What is the proper CFrame for this?

Made this script so that when a player gets stabbed the part gets stuck inside them, I want it to look like its pierced straight through the middle of the torso, always. But it always spawns somewhere random with random rotation, and if I set rotation of the part a piece of it does not stay put, although it is weld constrained on.

script:
This isnt all of it btw

Tool.EnhancedCone.Touched:Connect(function(Hit)
if attacking then
	if Hit.Parent then
		if Hit.Parent:FindFirstChild("Humanoid") then
			local Humanoid = Hit.Parent:FindFirstChild("Humanoid")
			local plr = game:GetService("Players")	:GetPlayerFromCharacter(Hit.Parent)
				--local vampire = plr:WaitForChild("Classes"):WaitForChild("Vampire")   -- RIGHT HERE <---------
				if not DB then
					DB = true
				--if vampire.Value == true then
				local ClonedStakeModel = StakeModel:Clone()
				ClonedStakeModel.Parent = workspace
				ClonedStakeModel.Part.CFrame = Hit.CFrame
				local Weld = Instance.new("WeldConstraint")
					Weld.Part0 = ClonedStakeModel.Part
					Weld.Part1 = Hit
					Weld.Parent = ClonedStakeModel
				
				Humanoid.Health -= 100
				--else
				--Humanoid.Health -= 1
				--end	
					wait(1)
					DB = false
				end	
			end
		end
	end
end)

Are any of these models anchored by any chance?

Add a Dummy to the workspace.

Position your prop where you want it.

Dupe the Dummy’s HumanoidRootPart and add it to your prop.

When you position the prop during game play just match your props HumanoidRootPart CFrame the player characters HumanoidRootPart CFrame.

It will always show up just as you want it.

Thanks for that epic roblox studio life hack

You’re welcome.

I’m glad I could help. I like to use parts instead of code because it’s is easier to see.

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