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

How Do I Change Parts Form To Ball Form?

Im making a game about rolling balls, I cant figure out how to make it so the brand new part turns into a ball not a brick.

--code snippet

ball = Instance.new("Part") ball.Position = Vector3.new("18.96, 44.902, -191.859") ball.Anchored = false ball.Shape = Ball < Error ball.Parent = game.Workspace

the error it gives me is "Invalid value for enum Shape"

3 answers

✓ Accepted answer

Easy, do this:

local part = Instance.new("Part")
part.Parent = workspace
part.Shape = Enum.PartType.Ball

you can just use line 3, it should work unless you change the ball's variable name.

And also, please use lua code blocks, they are at the top of the text body where you write questions and you should see a icon that says "Lua" on it, then put your code there.

let me know if you need more help!

2 comments

0

capitalize "I" in 'instance'

0

instance is deprecated, do Instance.new

There are two ways to do this, one with changing the shape of the base part instance (which can change the physical behavior), or by using a SpecialMesh (does not affect physical behavior but can give a better variety of shapes)

-- First Method

local Part = Instance.new("Part",workspace)
Part.CFrame = CFrame.new(18.96,44.902,-191.859)
Part.Anchored = false
Part.Shape = Enum.PartType.Ball

-- Second Method

local Part = Instance.new("Part",workspace)
Part.CFrame = CFrame.new(18.96,44.902,-191.859)
Part.Anchored = false
local SpecialMesh = Instance.new("SpecialMesh")
SpecialMesh.MeshType = Enum.MeshType.Sphere
SpecialMesh.Parent = Part
SpecialMesh.Scale = Part.Size

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