Currently, I’m trying to align start and end pads properly so that when you reach the end of one section the start pad of the next is right on top of the end pad, but I’m not sure how. Different sections have different placings of the start and end pads, so I’d need to account for that but I’m not sure how. Any ideas?
What are you saying? Please explain in a simpler way of what you want.
Trying to rotate the sections so that the start pad of the start pad of the next section and the end pad of the one below it meet.
I can’t understand what you’re trying to say unfortunately. If I knew what you meant, I’d probably be able to help.
Do you know Tower of Hell? You know how when you complete one stage, you immediately move on to the next and how the start point and end point for two stages are kinda in the same place
So like that @Wyzloc
Do you mean how each color is coordinated perfectly on the Y axis when you place down each obby? If this is what you mean then I suggest using an increment when creating your obby. Here’s an example of how it would look like:
local obbies={game.ReplicatedStorage.Obby1, game.ReplicatedStorage.Obby2} -- etc.
local increment = 5 -- size of the wall's Y axis
local num = 0
for i = 1,#obbies do
obby = obbies[i]:Clone()
obby.Parent = workspace
obby:SetPrimaryPartCFrame(CFrame.new(XCoord,YCoord + num,ZCoord))
num=num+increment
end
He seems to be refering to the rotation of the section such that the spawns are vertically aligned with the finish of the previous one.
Introduction
Surprisingly accomplishing something like this is fairly simple.
A while back I had the same question but I was able to figure it out by using SetPrimaryPartCFrame. Although, It’s not just that one function alone. You need to pair that with the towers. First, let’s create two separate towers of two different sizes as shown below.
Getting Started
.
Now let’s observe what each tower has.
You can download this template here: Template-Files.rbxm (11.9 KB)
Let’s define each part.
- Platform Bottom - This part will always be at the bottom of each tower stage.
-
Platform Top - This part is at the top of the tower always. It should be right above the Platform Bottom.
Connection Part - This is the most important part. This part will let us know to align the next stage/level right above it.
Code
Now that we know what each stage looks like let’s get started with the code. Now, this code is only meant to represent adding stages on top of each other and in no way should represent what your code looks like for your TOH game.
For starters, let’s add all of our “levels” into a folder named “Towers” in “ServerStorage”
Visualization
Now, before we start we need to create a “lobby” that all of our towers can stack onto. For this I will just be cloning the Orange tower and changing the color to gray and then changing the name to Lobby.
Great! Now let’s write some code.
In ServerScriptService let’s create a Server Script with the following Source
--// Services
local Workspace = game:GetService("Workspace");
local ServerStorage = game:GetService("ServerStorage");
--// Directories
local Lobby = Workspace:WaitForChild("Lobby"); -- Pulls the Lobbby from Workspace
local Towers = ServerStorage:WaitForChild("Towers"):GetChildren(); -- Pulls the Towers folder from ServerStorage and creates a table of it's children
--// Environment Variables
local STACK_COUNT = 10; -- The number of towers to stack on the lobby.
--// Source
local nextCFrame = Lobby:WaitForChild("System"):WaitForChild("EndSegment"):WaitForChild("ConnectPart").CFrame -- Get's the CFrame of the Lobby Connect Part
for i = 1, STACK_COUNT do
local chosenTower = Towers[math.random(1, #Towers)]:Clone(); -- Picks a random tower and clones it;
chosenTower.Parent = Workspace; -- Set's Parent
chosenTower:SetPrimaryPartCFrame(nextCFrame); -- Set's the towers primary part to the connection part
nextCFrame = chosenTower:WaitForChild("System"):WaitForChild("EndSegment"):WaitForChild("ConnectPart").CFrame -- Set's next CFrame
end
In result we get
Download the place file here: DemoPlace.rbxl (40.5 KB)