What do you want to achieve? Keep it simple and clear!
I want to achieve adding a part from scripting, when I play the game the part spawns with 0.5 transparency.
What is the issue? Include screenshots / videos if possible!
When I enter this code it does not work:
local Part = Instance.new(“Part”)
Part.Parent = game.Workspace
Part.Transparency = 0.5
I am learning scripting, and I was watching this video,
Go to [03:38] | nil, to see the part I was on.
What solutions have you tried so far? Did you look for solutions on the Developer Hub?
Tried watching other videos, and redoing the code.
The script is a normal script inside another part called PinkPart, inside of Workspace. In your script you added part.CFrame = CFrame.new(Vector3.zero), but it was never put in the video i put above, and it worked perfectly fine for him without your added line.
I asked ChatGPT cause I don’t know, but it told me to enter this code:
local Part = Instance.new(“Part”)
Part.Parent = game.Workspace
Part.Transparency = 0.5
Part.Size = Vector3.new(4, 1.2, 2) – Default size, but explicitly set for clarity.
Part.Position = Vector3.new(0, 50, 0) – Position the part 50 studs above the origin to make it easily visible.
print(“Part created”) – Confirm in output that the script ran.
I entered it and it worked however I want it to work with the code I put it in at the beginning for my example, it’s supposed to work according to the tutorial, but why isin’t the code working?
Could you please share a screenshot of your Explorer window? The component may have been created, but it might be obscured by the default SpawnLocation or another element.