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
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.
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
.