I was working on a script which imitates a dropper (like in a tycoon game), but for some reason the new parts are anchored after the first new part. Like, to further explain, the first part it ever drops is unanchored, which I want, but every part dropped after that one is anchored for some reason. All help is appreciated!
local part = script.Parent
local function spawnPart()
local newPart = Instance.new("Part")
newPart.Parent = game.Workspace
newPart.Anchored = false
newPart.Size = Vector3.new(.5,.5,.5)
local offset = Vector3.new(0, -1, 0)
newPart.CFrame = part.CFrame + offset
end
while true do
spawnPart()
wait(5)
end
Possibly Roblox is automatically anchoring your parts as you down then because your setting the position. Possibly we could delay the anchor after setting the position. Like this:
local part = script.Parent
local function spawnPart()
local newPart = Instance.new("Part")
newPart.Parent = game.Workspace
newPart.Size = Vector3.new(.5,.5,.5)
local offset = Vector3.new(0, -1, 0)
newPart.CFrame = part.CFrame + offset
wait(0.001)
newPart.Anchored = false
end
while true do
spawnPart()
wait(5)
end
I applied all the things you said, which seemed like they definitely should have worked, but to no avail. Maybe its something to do with a plugin I own or something deeper like that? I’m not too sure.
Parts automatically have the Anchored Property set to false, what you are saying will not help the OP with what he is doing.
@watsup1087
If you are referring the Momentary pause in the Air, that has to do with something called Network Ownership which has nothing to do with a Part being anchored
Well, that’s not my problem unfortunately. I go into a test play and when I view the parts properties anchored is true in all but the first part that dropped. And also, I created the script, so there should be no reason that Network Ownership would have an impact on the way it works.
function SpawnIn()
local P = Instance.new("Part")
P.Size = Vector3.new(.5,.5,.5)
local offset = Vector3.new(0, -1, 0)
P.CFrame = workspace.P1.CFrame + offset
P.Parent = workspace
end
while true do
SpawnIn()
task.wait(.5)
end
Works fine.
Anchored Defaults to false
Size works
It does
When playing the game, You can notice a Stutter of the Physics as the Owner is applied to the Server, You set it to the Player if they own it, or the other way around.
Well now I know for a fact that it has something to do with another script in the game or a plugin because your code did the exact same thing in my baseplate as my original code was doing. Thanks for checking in your own baseplate, I’ll just have to try in a new baseplate and if the issue continues I’ll just have to see about some of my old plugins.
You can’t see the properties menu unfortunately but you’ll just have to take me on my word that the first like 3 blocks that drop are unanchored but the rest afterwards arent.