Position is not a valid member of Model?
Hello, the issue is on line 27 and despite it being a part it keeps returning the error "Position is not a valid member of Model".
I'm trying to make a auto-generating track.
Problem Code:
1 | newMiddle.Position = Vector 3. new(mainMiddle.Middle.Size.X/ 2 , 0 , 0 ) |
2 | + middle.Finish.Position |
01 | local ReplicatedStorage = game:GetService( "ReplicatedStorage" ) |
02 | local mapsFolder = ReplicatedStorage:WaitForChild( "Maps" ) |
03 | local maps = mapsFolder:GetChildren() |
05 | local lobby = game.Workspace:WaitForChild( "Lobby" ).Lobby |
08 | local mainMiddle = mapsFolder.Middle |
11 | for i = 1 , maxLength do |
12 | local middle = mapsFolder.Middle:Clone() |
13 | middle.PrimaryPart = middle.Start |
14 | middle.Parent = game.Workspace.Track |
15 | middle.Finish.Transparency = 1 |
17 | local nextMiddle = game.Workspace.Track:FindFirstChild( "Middle2" ) |
18 | if nextMiddle = = nil then |
19 | local newPosition = Vector 3. new(lobby.Size.X/ 2 , 0 , 0 ) + lobby.Position |
20 | middle:MoveTo(newPosition) |
22 | local theMiddle = game.Workspace:FindFirstChild( "Middle" ..i- 1 ) |
23 | local newPosition = Vector 3. new(theMiddle.Size.X/ 2 , 0 , 0 ) + theMiddle.Position |
24 | middle:MoveTo(newPosition) |
27 | local newMiddle = mainMiddle:Clone() |
29 | newMiddle.Position = Vector 3. new(mainMiddle.Middle.Size.X/ 2 , 0 , 0 ) + middle.Finish.Position |
30 | newMiddle.Parent = game.Workspace.Track |
31 | newMiddle.Name = "Middle" ..i |