The gap between the player and the dummy is the center and not the player

I was making something for my friend and it was going well, but when i walk around i move weirdly.

'local SummonEvent = game.ReplicatedStorage.StandEvent
local StandPrefab = game.ServerStorage.Stands.TestStand

local function Summon(character)
local rootpart = character:FindFirstChild(“HumanoidRootPart”)
local Stand = StandPrefab:Clone()
local Stand_RP = Stand.PrimaryPart
Stand_RP.CFrame = rootpart.CFrame * CFrame.new(0, 2, 3)
local Weld = Instance.new(“Weld”)
Weld.Part0 = Stand_RP
Weld.Part1 = rootpart
Weld.C1 = CFrame.new(0,2,3)

Weld.Parent = Stand
Stand.Parent = character
return Stand

end
local function Unsummon(character)
local stand = character:FindFirstChild(“TestStand”)
stand:Destroy()
end
SummonEvent.OnServerEvent:Connect(function(player)
local character = player.Character
local Stand = character:FindFirstChild(“TestStand”)

if Stand then
	Unsummon(character)
else
	Summon(character)
end

end)’


I believe that it is making the center the gap between the player and the dummy.
But i can’t figure out how to make the center the player instead.

3 Likes

I made same thing by making new fakehumrp which is aligned by position and orientation to original humrp. After that I just weld stand’s humrp to the fakehumrp.

I think weld can affect the way cframe changes smh

local stand = workspace.Stand
stand.HumanoidRootPart.Anchored = false
local plr = game:GetService("Players").LocalPlayer
local char = plr.Character
local humrp = char:FindFirstChild("HumanoidRootPart")
local hum = char:WaitForChild("Humanoid")



local fakehumrp = Instance.new("Part")
fakehumrp.Size = humrp.Size
fakehumrp.Name = "FakeHumanoidRootPart"
fakehumrp.Parent = humrp
fakehumrp.CanCollide = false
fakehumrp.Massless = false

local Attachment0 = fakehumrp:FindFirstChild("RootAttachment") or Instance.new("Attachment")
Attachment0.Parent = fakehumrp

local Attachment1 = humrp:FindFirstChild("RootAttachment") or Instance.new("Attachment")
Attachment1.Parent = humrp


local AlignOrientation = Instance.new("AlignOrientation")
AlignOrientation.Mode = Enum.OrientationAlignmentMode.TwoAttachment
AlignOrientation.Attachment0 = Attachment0
AlignOrientation.Attachment1 = Attachment1
AlignOrientation.Parent = fakehumrp
AlignOrientation.Responsiveness = 200
AlignOrientation.MaxTorque = 100000

local AlignPosition = Instance.new("AlignPosition")
AlignPosition.Mode = Enum.PositionAlignmentMode.TwoAttachment
AlignPosition.Attachment0 = Attachment0
AlignPosition.Attachment1 = Attachment1
AlignPosition.Parent = fakehumrp
AlignPosition.Responsiveness = 200
AlignPosition.MaxForce = 100000

local Weld = Instance.new("Weld")
Weld.Parent = stand
Weld.Part0 = stand.HumanoidRootPart
Weld.Part1 =  fakehumrp
Weld.C1 = CFrame.new(0,2,3)
2 Likes

Btw I guess that you should choose another category(scripting support).

1 Like