Using Player Spawns
Using Player Spawns
Spawns are used to position a character when they start the game or re-spawn. Characters will still spawn if there are no
SpawnLocation objects in the place, but they’ll just drop into the center.
Inserting a Spawn
To insert a spawn in Roblox Studio:
- In the Explorer window, hover your mouse over Workspace.
- Click the circle button.
- Scroll through the drop-down list until you find SpawnLocation and click on it. This will insert a completely functional spawn.
A neutral spawn is a spawn location where anybody can spawn, regardless of their team. In most cases a neutral spawn is used in the in games that have no teams, but can always be used. To make a spawn neutral, all you need to do is open up the SpawnLocation’s properties and make sure the
SpawnLocation/Neutral property is true.
Team spawns require not only a
SpawnLocation, but also a
Team object. Insert one of these the same as you insert a spawn, Insert > Object > Team.
You will need to make sure the team is a child of the
Teams in order for it to work properly. Setting up the team is simple.
The first thing you’ll want to do with your new team, is set the name of it. The name can be anything you want, the part that matters is the
Find the TeamColor property in the team, and set it to whatever color you want, but keep in mind you can only have 1 team per color.
If you want players to be able to automatically be on that team at the beginning of the game, set the
Team/AutoAssignable property to true.
SpawnLocation/AllowTeamChangeOnTouchproperty set to true or via scripting!
Now that you have your
Team, you need to match the
SpawnLocation to it. Do this by finding the
SpawnLocation/TeamColor property, and setting it to the same color as the
Team/TeamColor property. Keep in mind the
Articles/BrickColor Codes of the spawn does not influence the spawn’s behavior.
Allowing players to change teams is simple, just set the
SpawnLocation/AllowTeamChangeOnTouch property to true.
SpawnLocation|SpawnLocations are often used to make checkpoints in obstacle courses or similar games. To achieve this:
- Create a
SpawnLocationcorresponding to a different
Teamfor each checkpoint.
SpawnLocation/AllowTeamChangeOnTouch|AllowTeamChangeOnTouchfor each checkpoint.
When a player touches the spawn location, their team will be changed. If their character dies, they’ll re-spawn at that location, since each team only has one assigned
- Only the team corresponding with the first
Team/AutoAssignableset to true, otherwise players will not start at the first checkpoint.
SpawnLocation/Neutralshould be set to false for all spawns.
- Under this setup, players may go “backwards” through checkpoints if they touch a spawn location for a previous checkpoint. One solution is setting
SpawnLocation/AllowTeamChangeOnTouch|AllowTeamChangeOnTouchto false once a player touches a checkpoint, using a
LocalScript. This will not replicate to the server and means the player can not lose progress by touching an earlier checkpoint.