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

Part.Anchored = false doesn't work?

I'm currently learning basics of scripting and I came across Instance.new

local Part = workspace.Part

Instance.new("Part")
Part.Anchored = false
Part.BrickColor = BrickColor.new("Dark green")
Part.Position = Vector3.new(0,100,0)

Apparently, Part.Anchored = false doesn't work because the part stays anchored

2 answers

✓ Accepted answer

Because you have 2 Parts in workspace, and you make the script confused so what the script does it chooses 1 part to be un-anchored. Try naming the other part to something like Part2.

You got another part due to Instance.new("Part") without naming it, leaving the name to Part.

Hope this helps, if this does please accept this answer and upvote. Thank you.

3 comments

0

Now it says that Part is not valid member of workspace

1

Can you show me the script?

0

Put the part in the workspace

The part is never created because you never gave it a Parent.

When you use Instance.new() you should always assign a Parent to the Instance. It's usually best to leave this for last and allow the other properties of the Instance to come first. If you fail to give the Instance a parent it will float around in thin air.

Also, when you are using the constructor, Instance.new() returns the created Instance, and thus you'd have to assign it to a variable. Without assigning it to a variable the compiler will have no idea what you're referring to.

Going to this: "because you have 2 Parts in workspace". The second part was never given a parent. If your initial idea was to edit the newly created part, then parent that new part to the Workspace and give it a different Name so it doesn't get confused with other Instances called Part.

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