So I watched TheDevKings video and decided to try to recreate what he did.
But I am having this problem:
For some reason the parts start to fall, all parts are anchored.
I have tried welding the part but the same problem occurred.
So I watched TheDevKings video and decided to try to recreate what he did.
But I am having this problem:
For some reason the parts start to fall, all parts are anchored.
I have tried welding the part but the same problem occurred.
Could you show us your code…?
They must be anchored and cancollide must be set on. Not sure if this is the error, but it might be. Thanks for reading, have an amazing day/night.
if its anchored. it should not fall off. What is the script to create this infinite amount of stages?
local StartModel = game:GetService("ServerStorage").StartModel
local Offset = Vector3.new(25,0,0)
function generate(count)
local ClonedModel = StartModel:Clone()
ClonedModel.Parent = workspace
ClonedModel.Name = "Model"..count
if not game.Workspace:FindFirstChild("Model"..count-1) then
print("There is no previous model")
ClonedModel:MoveTo(game.Workspace:FindFirstChild("StartModel").End.Position + Offset)
else
print("There was a previous model")
ClonedModel:MoveTo(game.Workspace:FindFirstChild("Model".. count-1).End.Position + Offset)
end
end
for count = 1, 100, 1 do
generate(count)
end
That’s why I also said that cancollide must be on, oh and happy birthday!
Can collide is on and I hope you have an amazing day/night too!
Hey! Thanks for the nice words. I watched the video for devking myself and I was trying to replicate, but I couldn’t understand.
Add ClonedModel.Anchored = true
just in case. That might be the problem.
It still falls, if it wasn’t anchored it would just fall out of the world, but it doent.
The Y position of the end part starts off as 0.5 then drops to -4 and keeps going down by 4.5 studs until it reaches 399.5 and starts going straight again:
Try using SetPrimaryPartCFrame().
local StartModel = game:GetService("ServerStorage").StartModel
local Offset = 25
function generate(count)
local ClonedModel = StartModel:Clone()
ClonedModel.Parent = workspace
ClonedModel.Name = "Model"..count
if not game.Workspace:FindFirstChild("Model"..count-1) then
local currentModel = game.Workspace:FindFirstChild("StartModel").End
print("There is no previous model")
ClonedModel:MoveTo(Vector3.new(currentModel.Position.X + Offset, currentModel.Position.Y, currentModel.Position.Z))
else
local currentmodel = game.Workspace:FindFirstChild("Model".. count-1).End
print("There was a previous model")
ClonedModel:MoveTo(Vector3.new(currentmodel.Position.X + Offset, currentmodel.Position.Y, currentmodel.Position.Z))
end
end
for count = 1, 100, 1 do
generate(count)
end
This might work, but I don’t know.
I did this:
ClonedModel.PrimaryPart = ClonedModel.Start
and it worked I don’t know why, can anyone explain?
Edit:
I saw this on the devhub:
BasePart
PrimaryPart
Points to the Model
's primary part. The part is the BasePart
that is used as a basis when positioning the model using the Model:MoveTo
and Model:SetPrimaryPartCFrame
functions.