What do you want to achieve? It Is very simple but somehow, for me, is complicated; I’m trying to create a lobby where the player stays in a certain position and posture, like the dummy in the picture.
What is the issue? I can set the player’s position, but I don’t know how to clone the “posture.”
What solutions have you tried so far? tried to set player humanoidRootPart.Cframe = dummy…CFrame, also i tried to clone all humanoidParts Rotation/Position to player
I’m NOT looking for some1 to script this for me but point me in the right direction.
so this only works on the server side, so since the lobby is local script it requires a remote event or some kinda of property to communicate. Will try that in a few and give the feed back , thank you
I also tested GetAccessories and appended them to the dummy, but the result was weird, so I came up whit this. Basically, I copy all Motor6D C0 and C1 values from each part of the dummy and set them to a cloned player.
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local RunService = game:GetService("RunService")
--
local Player = game.Players.LocalPlayer
local Character = Player.Character or Player.CharacterAdded:Wait()
local Humanoid = Character:WaitForChild("Humanoid")
local Camera = workspace.CurrentCamera
--
-- dummy exists already
if workspace:FindFirstChild("Dummy"..Player.UserId) then
return
end
-- change camera view
repeat wait()
Camera.CameraType = Enum.CameraType.Scriptable
until Camera.CameraType == Enum.CameraType.Scriptable
Camera.CFrame = workspace.Porch.Camera.CFrame
--
local DummyDefault = workspace.Dummy
local dummyData = {}
--
------------------------- get dummy data
--
for i, part in pairs(DummyDefault:GetChildren()) do
--
if part:IsA('MeshPart') then
--
for i,instance in ipairs(part:GetChildren()) do
--
if instance:IsA("Motor6D") then
dummyData[instance.Name] = {instance.C0,instance.C1}
end
end
end
end
dummyData.orientation = DummyDefault.HumanoidRootPart.Orientation
dummyData.position = DummyDefault.HumanoidRootPart.Position
--
DummyDefault:Destroy()
--
------------------------- Clone player
--
Character.Archivable = true
local playerDummy = Character:Clone()
Character.Archivable = false
--
playerDummy.Archivable = true
playerDummy.Name = "Dummy"..Player.UserId
playerDummy.Parent = workspace
playerDummy:WaitForChild("Humanoid").DisplayName = " "
RunService.Heartbeat:Wait()
--
local dummyPosition = CFrame.new( dummyData.position)
local dummyOrientation = CFrame.Angles(
math.rad( dummyData.orientation.X),
math.rad( dummyData.orientation.Y),
math.rad( dummyData.orientation.Z)
)
playerDummy:SetPrimaryPartCFrame( dummyPosition *dummyOrientation )
------------------------------------------------------------------
for _, part in ipairs(playerDummy:GetChildren()) do
--
if part:IsA('MeshPart') then
--
for _,instance in ipairs(part:GetChildren()) do
--
if instance:IsA("Motor6D") then
--
if dummyData[instance.Name] then
instance.C0 = dummyData[instance.Name][1]
instance.C1 = dummyData[instance.Name][2]
end
end
end
end
end
I don’t know if this is the best approach, but it works as expected on localscript.