I’m currently developing a new intro sequence for my game that will play at the start and end of each round. However, I’m at a bit of a problem currently - I can’t figure out how to have every player in a set pattern like so:
Some of my map’s maximum player count is 64 players, but I’d like this to be able to go on forever, in case a map has a substantially higher player count.
The jist of this would be every player would be in front of a camera, and would be able to do a taunt or some other animation while in front of the camera. After both teams are displayed, it’ll delete the “fake” characters and then start the game. Halo 5, Operation Scorpion, and Unreal Tournament 4 all have this feature. Wanting to implement it in my own game.
You can clone the player, which can be done by setting the Archivable Property of the Character Model to true, and cloning it. Then you manually positioning the CFrame and Orientation of the HumanoidRootPart to face the camera.That’s just an idea though.
I’m aware of being able to clone the player, however, I’m still unsure of how to get the players to be placed in a pattern like the blocks in the image.
An algorithm that is able to generate that pattern is pretty complex. Best thing is to make the pattern with the max numbers of players then turn that into an array in the order you want them to be teleported in.
local Locations = { -- Contains the locations of the parts in descending order
location1, location2, location3, location4 -- These would be a cframe value
}
for i,Player in pairs(Players) do -- An array containing the players
Player.Character.HumanoidRootPart.CFrame = Locations[i] -- Using the index of the player it is on
end
Hm… I can’t figure it out either. Seems like something really complex you’re trying to achieve here.
Personally, I think I would have an idea of how to begin That’s mostly based off of the model you posted. I probably don’t have your concrete solution, but perhaps somewhere that you can begin on.
The player in the red slot is an outlier and the party leader. They can be ignored and handled separately. The rest of the players are handled like a table or whatever you’d like.
Now notice the way you chose to lay it out. There’s a middle column behind the leader and each row of parts is three per row. The outside parts increasingly separate (the blue lines), but the centre column stays the same. You can envision the players behind the leader in this sort of an expression:
Each row after the leader is arranged in P1 P2 P3 format (Left Middle Right)
P2 (Middle) is in a constant single file line behind the leader
P1 (Left) and P3 (Right) are an offset beside P2
What you can probably do is organise the outside players to be an offset from the player in the middle, then increment that offset for use on the next row of players.
That’s the least I have a clue of. You might experience issues with my method, such as incomplete or uneven rows depending on the number of players. If that’s a non-concern for you, then I suppose this could work out somehow?
If you want to avoid the really complex math:
Perhaps take the parts just like you have, and group in a Model
In a script, Clone the model, Set a primary part, and set the parts CFrame.
Then you can move the groups of positions however you like.
Put the positional data of each part into a table, and do things, like teleport players!
Here’s a really crude example of what I mean, without the teleporting players part.
local Model = game.Workspace.PositionTemplate
for i=1,15 do
local newGroup = Model:Clone()
local offset = 30*i
newGroup.Name = Model.Name .. i
newGroup.Parent = Model.Parent
newGroup.PrimaryPart=newGroup.MainPart
newGroup:SetPrimaryPartCFrame(CFrame.new(Vector3.new(newGroup.PrimaryPart.Position.X+offset, newGroup.PrimaryPart.Position.Y,newGroup.PrimaryPart.Position.Z)))
end
Yes definitely. If you give each part a unique name, you can basically index each position and fine tune it.
So in the loop you could just create a table:
local TeleportPoints = {}
for i=1,15 do
TeleportPoints[i] = {} --set a new table for this group
local newGroup = Model:Clone()
local Points = Model:GetChildren()
--chose your favorite loop to iterate and add here
...
end
It should use the orientation of the template as is. I am not very versed with the CFrame stuff, but you should be able to tweak that line and get desired results.