Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Why does the Clone of a Character not have a Position,CFrame, Appearance, or anything!?

I wrote this Script:

--This is a ServerScript
game.Players.PlayerAdded:Connect(function(plr)
    local Char = (plr.Character or plr.CharacterAdded:Wait())
    Char.Archivable = true
    local CharClone = Char:Clone()
    CharClone.Parent = game.Workspace.Clones
end)

Next, I wanted to make the Clone visible inside a ViewportFrame:

Clones = game.Workspace.Clones:GetChildren()

Camera = Instance.new("Camera")
script.Parent.CurrentCamera = Camera

Camera.CameraType = "Scriptable"
Camera.CFrame = Clones[1].CFrame
Clones[1].Parent = script.Parent

But it just errors:

CFrame is not a valid member of Model

What do I have to change? Thanks in advance!

1 answer

Models do not have CFrame, Size or Position. Only BaseParts do. If you want to change its CFrame, you can change the PrimaryPart's CFrame which will move all parts joined to it as well, using this function:

CharClone:SetPrimaryPartCFrame( yourcframehere )

I don't think you can resize Models, but for characters you can use the R15 sizing values(located inside of the Humanoid) for that.

Hope this helped

3 comments

0

Models can be resized, they will just resize themselves while keeping their original size ratio (you cannot make a model bigger only on the Z axis, resizing it will make it larger on the Y and Z axes if you hold a click in that direction).

0

I can't find anything in the API docs that mentions this, could you please elaborate?

0

@DeceptiveCaster That's a feature in studio. However, it is not an actual feature in-script.

This discussion is preserved as it was. New answers, comments, and votes are closed.