Source: Roblox Creator Hub · CC BY 4.0 · View source · Code samples: MIT Imported 2026-10-03. Formatting adapted for this site.
SpawnLocation
Inherits from: Part → FormFactorPart → BasePart → PVInstance → Instance → Object
SpawnLocations, or "spawns" determine where a Player respawns when they die. They can be configured to allow only certain players to use each spawn, using Teams. They also control how ForceFields are set up for newly-spawned players.
SpawnLocations can be used as checkpoints, such as in an obstacle course, using the SpawnLocation.AllowTeamChangeOnTouch property, so that when a player touches it, they will change teams to the SpawnLocation's team. In this case, only the first Team should have Team.AutoAssignable set to true, else players will not start at the first checkpoint.
Note if a SpawnLocation is added to the Workspace in Studio with SpawnLocation.Neutral set to false a Team will be created corresponding to SpawnLocation.TeamColor if it does not already exist. This behavior does not occur when spawns are created in-game using a Script or if the properties of the SpawnLocation are changed after already being added. It is recommended that developers always set up their teams manually and not rely on this behavior.
Spawning Rules
There are several rules that come into play for a given SpawnLocation when a player respawns:
- When
SpawnLocation.Neutralis set to false onlyPlayerswithPlayer.TeamColormatchingSpawnLocation.TeamColorwill respawn above it - When
SpawnLocation.Neutralis set to true any Player can spawn above it regardless ofSpawnLocation.TeamColor - If multiple eligible spawns are available to a
Player, a random one will be chosen - Players will spawn at different points on top of a SpawnLocation, but currently, they may still spawn on top of each other if they spawn right after one and other
See also:
- If you'd like to configure how long it takes for a player to respawn, take a look at the
RespawnTimeproperty
Inherits from: Part
Memory category: BaseParts
Code samples: View on Creator Hub (SpawnLocation-Checkpoints).
Properties
| Name | Type / Returns | Description |
|---|---|---|
| SpawnLocation.AllowTeamChangeOnTouch | boolean | Allows a Player to join the team by touching the SpawnLocation. When set to true, if a Player character comes into contact with the SpawnLocation, the player's Player.TeamColor will be set to SpawnLocation.TeamColor. |
| SpawnLocation.Duration | int | The length of time, in seconds, that a ForceField will be applied to a Player character spawning at this SpawnLocation. If Duration is zero, the ForceField is never created, and it will not trigger the Instance.DescendantAdded or Instance.ChildAdded events. |
| SpawnLocation.Enabled | boolean | Sets whether or not the SpawnLocation is enabled. When disabled players cannot spawn at the SpawnLocation and the AllowTeamChangeOnTouch functionality is disabled. |
| SpawnLocation.Neutral | boolean | Whether or not a SpawnLocation is affiliated with a specific team. This means that any Player, of any Team, can spawn on it if this property is set to true. |
| SpawnLocation.TeamColor | BrickColor | Sets what team the SpawnLocation is affiliated to. If SpawnLocation.Neutral property is false, only Players with the same Player.TeamColor as the spawn's TeamColor will be able to spawn there. |
Inherited from Part
| Name | Type / Returns | Description |
|---|---|---|
| Part.Shape | PartType | Sets the overall shape of the object. |
Inherited from FormFactorPart
| Name | Type / Returns | Description |
|---|---|---|
| FormFactorPart.FormFactor | FormFactor | This used to specify a grid constraint of the part's size. No longer does anything. |
| FormFactorPart.formFactor | FormFactor | Determines how a part acts when resized and the values that which its size can take. |
Inherited from BasePart
| Name | Type / Returns | Description |
|---|---|---|
| BasePart.Anchored | boolean | Determines whether a part is immovable by physics. |
| BasePart.AssemblyAngularVelocity | Vector3 | The angular velocity of the part's assembly. |
| BasePart.AssemblyCenterOfMass | Vector3 | The center of mass of the part's assembly in world space. |
| BasePart.AssemblyLinearVelocity | Vector3 | The linear velocity of the part's assembly. |
| BasePart.AssemblyMass | float | The total mass of the part's assembly. |
| BasePart.AssemblyRootPart | BasePart | A reference to the root part of the assembly. |
| BasePart.AudioCanCollide | boolean | Determines whether the part will physically interact with audio simulation, similar to CastShadow for lighting. |
| BasePart.BackParamA | float | Determines the first parameter for the SurfaceType on the Back face of a part. |
| BasePart.BackParamB | float | Determines the second parameter for the SurfaceType on the Back face of a part. |
| BasePart.BackSurface | SurfaceType | Determines the type of surface for the back face of a part. |
| BasePart.BackSurfaceInput | InputType | Determines the kind of input for the Back face of a part. |
| BasePart.BottomParamA | float | Determines the first parameter for the SurfaceType on the Bottom face of a part. |
| BasePart.BottomParamB | float | Determines the second parameter for the SurfaceType on the Bottom face of a part. |
| BasePart.BottomSurface | SurfaceType | Determines the type of surface for the bottom face of a part. |
| BasePart.BottomSurfaceInput | InputType | Determines the kind of input for the Bottom face of a part. |
| BasePart.BrickColor | BrickColor | Determines the color of a part. |
| BasePart.brickColor | BrickColor | |
| BasePart.CanCollide | boolean | Determines whether a part may collide with other parts. |
| BasePart.CanQuery | boolean | Determines whether the part is considered during spatial query operations. |
| BasePart.CanTouch | boolean | Determines if Touched and TouchEnded events fire on the part. |
| BasePart.CastShadow | boolean | Determines whether or not a part casts a shadow. |
| BasePart.CenterOfMass | Vector3 | Describes the world position in which a part's center of mass is located. |
| BasePart.CFrame | CFrame | Determines the position and orientation of the BasePart in the world. |
| BasePart.CollisionGroup | string | Describes the name of a part's collision group. |
| BasePart.CollisionGroupId | int | Describes the automatically set ID number of a part's collision group. |
| BasePart.Color | Color3 | Determines the color of a part. |
| BasePart.CurrentPhysicalProperties | PhysicalProperties | Indicates the current physical properties of the part. |
| BasePart.CustomPhysicalProperties | PhysicalProperties | Determines several physical properties of a part. |
| BasePart.Elasticity | float | Used to control the Elasticity of the part, but it no longer does anything. |
| BasePart.EnableFluidForces | boolean | Used to enable or disable aerodynamic forces on parts and assemblies. |
| BasePart.ExtentsCFrame | CFrame | The CFrame of the physical extents of the BasePart. |
| BasePart.ExtentsSize | Vector3 | The actual physical size of the BasePart as regarded by the physics engine. |
| BasePart.Friction | float | Used to control the Friction of the part, but now it no longer does anything. |
| BasePart.FrontParamA | float | Determines the first parameter for the SurfaceType on the Front face of a part. |
| BasePart.FrontParamB | float | Determines the second parameter for the SurfaceType on the Front face of a part. |
| BasePart.FrontSurface | SurfaceType | Determines the type of surface for the front face of a part. |
| BasePart.FrontSurfaceInput | InputType | Determines the kind of input for the Front face of a part (-Z direction). |
| BasePart.LeftParamA | float | Determines the first parameter for the SurfaceType on the Left face of a part. |
| BasePart.LeftParamB | float | Determines the second parameter for the SurfaceType on the Left face of a part. |
| BasePart.LeftSurface | SurfaceType | Determines the type of surface for the left face of a part. |
| BasePart.LeftSurfaceInput | InputType | Determines the kind of input for the Left face of a part. |
| BasePart.LocalTransparencyModifier | float | Determines a multiplier for BasePart.Transparency that is only visible to the local client. |
| BasePart.Locked | boolean | Determines whether a part is selectable in Studio. |
| BasePart.Mass | float | Describes the mass of the part, the product of its density and volume. |
| BasePart.Massless | boolean | Determines whether the part contributes to the total mass or inertia of its rigid body. |
| BasePart.Material | Material | Determines the texture and default physical properties of a part. |
| BasePart.MaterialVariant | string | The name of MaterialVariant. |
| BasePart.Orientation | Vector3 | Describes the rotation of the part in the world. |
| BasePart.PivotOffset | CFrame | Specifies the offset of the part's pivot from its CFrame. |
| BasePart.Position | Vector3 | Describes the position of the part in the world. |
| BasePart.ReceiveAge | float | Time since last recorded physics update. |
| BasePart.Reflectance | float | Determines how much a part reflects the skybox. |
| BasePart.ResizeableFaces | Faces | Describes the faces on which a part may be resized. |
| BasePart.ResizeIncrement | int | Describes the smallest change in size allowable by the Resize() method. |
| BasePart.RightParamA | float | Determines the first parameter for the SurfaceType on the Right face of a part. |
| BasePart.RightParamB | float | Determines the second parameter for the SurfaceType on the Right face of a part. |
| BasePart.RightSurface | SurfaceType | Determines the type of surface for the right face of a part. |
| BasePart.RightSurfaceInput | InputType | Determines the kind of input for the Right face of a part (-X direction). |
| BasePart.RootPriority | int | The main rule in determining the root part of an assembly. |
| BasePart.Rotation | Vector3 | The rotation of the part in degrees for the three axes. |
| BasePart.RotVelocity | Vector3 | Determines a part's change in orientation over time. |
| BasePart.Size | Vector3 | Determines the dimensions of a part (length, height, width). |
| BasePart.SpecificGravity | float | The ratio of the part's density to the density of water determined by the BasePart.Material. |
| BasePart.TopParamA | float | Determines the first parameter for the SurfaceType on the Top face of a part. |
| BasePart.TopParamB | float | Determines the second parameter for the SurfaceType on the Top face of a part. |
| BasePart.TopSurface | SurfaceType | Determines the type of surface for the top face of a part. |
| BasePart.TopSurfaceInput | InputType | Determines the kind of input for the Top face of a part (+Y direction). |
| BasePart.Transparency | float | Determines how much a part can be seen through (the inverse of part opacity). |
| BasePart.Velocity | Vector3 | Determines a part's change in position over time. |
Inherited from PVInstance
| Name | Type / Returns | Description |
|---|---|---|
| PVInstance.Origin | CFrame | Editor-only property that reads and sets the world CFrame of the PVInstance's pivot, moving the entire instance when changed from the Studio Properties window. |
| PVInstance.Pivot Offset | CFrame | Editor-only property that displays and edits the pivot's CFrame relative to the instance, moving only the pivot and leaving the instance in place. |
Inherited from Instance
| Name | Type / Returns | Description |
|---|---|---|
| Instance.Archivable | boolean | Determines if an Instance and its descendants can be cloned using Instance:Clone(), and can be saved/published. |
| Instance.archivable | boolean | |
| Instance.Capabilities | SecurityCapabilities | The set of capabilities allowed to be used for scripts inside this container. |
| Instance.IsInSandbox | boolean | Indicates whether the instance is inside a sandboxed container. |
| Instance.Name | string | A non-unique identifier of the Instance. |
| Instance.Parent | Instance | Determines the hierarchical parent of the Instance. |
| Instance.PredictionMode | PredictionMode | Reflects the client-side prediction mode applied to the instance under server-authoritative physics. |
| Instance.RobloxLocked | boolean | A deprecated property that used to protect CoreGui objects. |
| Instance.Sandboxed | boolean | When enabled, the instance can only access abilities in its Capabilities list. |
| Instance.UniqueId | UniqueId | A unique identifier for the instance. |
Inherited from Object
| Name | Type / Returns | Description |
|---|---|---|
| Object.ClassName | string | A read-only string representing the class this Object belongs to. |
| Object.className | string |
SpawnLocation.AllowTeamChangeOnTouch
Allows a Player to join the team by touching the SpawnLocation. When set to true, if a Player character comes into contact with the SpawnLocation, the player's Player.TeamColor will be set to SpawnLocation.TeamColor. Player.Neutral will also be set to SpawnLocation.Neutral upon contact, meaning a player can also become neutral by touching a spawn location.
This will not function when SpawnLocation.Enabled is set to false.
Making Checkpoints
This feature is often used to make checkpoints in obstacle courses or similar games.
| Field | Value |
|---|---|
| type | boolean |
| security | {"read":"None","write":"None"} |
| thread safety | ReadSafe |
| category | Teams |
| serialization | {"can_load":true,"can_save":true} |
| capabilities | ["Basic","Players"] |
Code samples: View on Creator Hub (SpawnLocation-Checkpoints).
SpawnLocation.Duration
The length of time, in seconds, that a ForceField will be applied to a Player character spawning at this SpawnLocation. If Duration is zero, the ForceField is never created, and it will not trigger the Instance.DescendantAdded or Instance.ChildAdded events.
This default value of this property is 10 seconds.
The duration feature allows developers to easily give Players protection from 'spawn killing' which can be a frustrating experience for players. Note, ForceFields will only protect users from Explosions and weapons that use Humanoid:TakeDamage() to deal damage or otherwise check for a ForceField.
| Field | Value |
|---|---|
| type | int |
| security | {"read":"None","write":"None"} |
| thread safety | ReadSafe |
| category | Forcefield |
| serialization | {"can_load":true,"can_save":true} |
| capabilities | ["Basic","Players"] |
Code samples: View on Creator Hub (SpawnLocation-ForceField).
SpawnLocation.Enabled
Sets whether or not the SpawnLocation is enabled. When disabled players cannot spawn at the SpawnLocation and the SpawnLocation.AllowTeamChangeOnTouch functionality is disabled.
This property provides the most convenient way of preventing Players from spawning at a spawn.
Note, although team changing on touch using SpawnLocation.AllowTeamChangeOnTouch is disabled when Enabled is set to false, other touched events using BasePart.Touched will still fire.
| Field | Value |
|---|---|
| type | boolean |
| security | {"read":"None","write":"None"} |
| thread safety | ReadSafe |
| category | Behavior |
| serialization | {"can_load":true,"can_save":true} |
| capabilities | ["Basic","Players"] |
Code samples: View on Creator Hub (SpawnLocation-Enabled).
SpawnLocation.Neutral
Whether or not a spawn is affiliated with a specific team. This means that any Player, of any Team, can spawn on it if this property is set to true.
If Neutral is set to false, only players whose Player.TeamColor is equal to SpawnLocation.TeamColor can use the SpawnLocation.
If SpawnLocation.AllowTeamChangeOnTouch is true Player.Neutral will be set to this property upon contact with the spawn.
| Field | Value |
|---|---|
| type | boolean |
| security | {"read":"None","write":"None"} |
| thread safety | ReadSafe |
| category | Teams |
| serialization | {"can_load":true,"can_save":true} |
| capabilities | ["Basic","Players"] |
Code samples: View on Creator Hub (SpawnLocation-Checkpoints).
SpawnLocation.TeamColor
The TeamColor property sets what team the SpawnLocation is affiliated to. If SpawnLocation.Neutral property is false, only Players with the same Player.TeamColor as the spawn's TeamColor will be able to spawn there.
If SpawnLocation.AllowTeamChangeOnTouch is true Player.Neutral will be set to this property upon contact with the spawn.
| Field | Value |
|---|---|
| type | BrickColor |
| security | {"read":"None","write":"None"} |
| thread safety | ReadSafe |
| category | Teams |
| serialization | {"can_load":true,"can_save":true} |
| capabilities | ["Basic","Players"] |
Code samples: View on Creator Hub (SpawnLocation-Checkpoints).
Methods
Inherited from BasePart
| Name | Type / Returns | Description |
|---|---|---|
| BasePart:AngularAccelerationToTorque | Vector3 | Returns the torque needed to achieve a given angular acceleration on this part's assembly, optionally accounting for gyroscopic effects. |
| BasePart:ApplyAngularImpulse | () | Apply an angular impulse to the assembly. |
| BasePart:ApplyImpulse | () | Apply an impulse to the assembly at the assembly's center of mass. |
| BasePart:ApplyImpulseAtPosition | () | Apply an impulse to the assembly at specified position. |
| BasePart:BreakJoints | () | Breaks any surface connection with any adjacent part, including Weld and other JointInstance. |
| BasePart:breakJoints | () | |
| BasePart:CanCollideWith | boolean | Returns whether the parts can collide with each other. |
| BasePart:CanSetNetworkOwnership | Tuple | Checks whether you can set a part's network ownership. |
| BasePart:GetClosestPointOnSurface | Vector3 | Returns the closest point on the part's surface to the given point. |
| BasePart:GetConnectedParts | List | Returns a table of parts connected to the object by any kind of rigid joint. |
| BasePart:GetJoints | Instances | Return all Joints or Constraints that is connected to this Part. |
| BasePart:GetMass | float | Returns the value of the Mass property. |
| BasePart:getMass | float | |
| BasePart:GetNetworkOwner | Instance | Returns the current player who is the network owner of this part, or nil in case of the server. |
| BasePart:GetNetworkOwnershipAuto | boolean | Returns true if the game engine automatically decides the network owner for this part. |
| BasePart:GetNoCollisionConstraints | Instances | Returns the enabled NoCollisionConstraint objects currently registered for this part in its physics world. |
| BasePart:GetRenderCFrame | CFrame | OBSOLETE. Returns a CFrame describing where the part is being rendered at. |
| BasePart:GetRootPart | Instance | Returns the base part of an assembly of parts. |
| BasePart:GetTouchingParts | Instances | Returns a table of all BasePart.CanCollide true parts that intersect with this part. |
| BasePart:GetVelocityAtPosition | Vector3 | Returns the linear velocity of the part's assembly at the given position relative to this part. |
| BasePart:IntersectAsync | Instance | Creates a new IntersectOperation from the overlapping geometry of the part and the other parts in the given array. |
| BasePart:IsGrounded | boolean | Returns true if the object is connected to a part that will hold it in place (eg an Anchored part), otherwise returns false. |
| BasePart:MakeJoints | () | Creates a joint on any side of the object that has a surface ID that can make a joint. |
| BasePart:makeJoints | () | |
| BasePart:Resize | boolean | Changes the size of an object just like using the Studio resize tool. |
| BasePart:resize | boolean | |
| BasePart:SetNetworkOwner | () | Sets the given player as network owner for this and all connected parts. |
| BasePart:SetNetworkOwnershipAuto | () | Lets the game engine dynamically decide who will handle the part's physics (one of the clients or the server). |
| BasePart:SubtractAsync | Instance | Creates a new UnionOperation from the part, minus the geometry occupied by the parts in the given array. |
| BasePart:TorqueToAngularAcceleration | Vector3 | Returns the angular acceleration that would result from applying a given torque to this part's assembly, optionally accounting for gyroscopic effects. |
| BasePart:UnionAsync | Instance | Creates a new UnionOperation from the part, plus the geometry occupied by the parts in the given array. |
Inherited from PVInstance
| Name | Type / Returns | Description |
|---|---|---|
| PVInstance:GetPivot | CFrame | Gets the pivot of a PVInstance. |
| PVInstance:PivotTo | () | Transforms the PVInstance along with all of its descendant PVInstances such that the pivot is now located at the specified CFrame. |
Inherited from Instance
| Name | Type / Returns | Description |
|---|---|---|
| Instance:AddTag | () | Applies a tag to the instance. |
| Instance:children | Instances | Returns an array of the object's children. |
| Instance:ClearAllChildren | () | This method destroys all of an instance's children. |
| Instance:Clone | Instance | Create a copy of an instance and all its descendants, ignoring instances that are not Archivable. |
| Instance:clone | Instance | |
| Instance:Destroy | () | Sets the Instance.Parent property to nil, locks the Instance.Parent property, disconnects all connections, and calls Destroy() on all children. |
| Instance:destroy | () | |
| Instance:FindFirstAncestor | Instance? | Returns the first ancestor of the Instance whose Instance.Name is equal to the given name. |
| Instance:FindFirstAncestorOfClass | Instance? | Returns the first ancestor of the Instance whose Object.ClassName is equal to the given className. |
| Instance:FindFirstAncestorWhichIsA | Instance? | Returns the first ancestor of the Instance for whom Object:IsA() returns true for the given className. |
| Instance:FindFirstChild | Instance? | Returns the first child of the Instance found with the given name. |
| Instance:findFirstChild | Instance | |
| Instance:FindFirstChildOfClass | Instance? | Returns the first child of the Instance whose ClassName is equal to the given class name. |
| Instance:FindFirstChildWhichIsA | Instance? | Returns the first child of the Instance for whom Object:IsA() returns true for the given className. |
| Instance:FindFirstDescendant | Instance? | Returns the first descendant found with the given Instance.Name. |
| Instance:GetActor | Actor? | Returns the Actor associated with the Instance, if any. |
| Instance:GetAttribute | Variant | Returns the value which has been assigned to the given attribute name. |
| Instance:GetAttributeChangedSignal | RBXScriptSignal | Returns an event that fires when the given attribute changes. |
| Instance:GetAttributes | Dictionary | Returns a dictionary of the instance's attributes. |
| Instance:GetChildren | Instances | Returns an array containing all of the instance's children. |
| Instance:getChildren | Instances | |
| Instance:GetDebugId | string | Returns a coded string of the debug ID used internally by Roblox. |
| Instance:GetDescendants | Instances | Returns an array containing all of the descendants of the instance. |
| Instance:GetFullName | string | Returns a string describing the instance's ancestry. |
| Instance:GetStyled | Variant | Returns the styled or explicitly modified value of the specified property, or else the default property value if it hasn't been styled/modified. |
| Instance:GetStyledPropertyChangedSignal | RBXScriptSignal | Returns an event that fires when the given style property changes on the instance. |
| Instance:GetTags | Array | Gets an array of all tags applied to the instance. |
| Instance:HasTag | boolean | Check whether the instance has a given tag. |
| Instance:IsAncestorOf | boolean | Returns true if an Instance is an ancestor of the given descendant. |
| Instance:IsDescendantOf | boolean | Returns true if an Instance is a descendant of the given ancestor. |
| Instance:isDescendantOf | boolean | |
| Instance:IsPropertyModified | boolean | Returns true if the value stored in the specified property is not equal to the code-instantiated default. |
| Instance:QueryDescendants | Instances | Returns an array containing all descendants of the instance that match the selector string. |
| Instance:Remove | () | Sets the object's Parent to nil, and does the same for all its descendants. |
| Instance:remove | () | |
| Instance:RemoveTag | () | Removes a tag from the instance. |
| Instance:ResetPropertyToDefault | () | Resets a property to its default value. |
| Instance:SetAttribute | () | Sets the attribute with the given name to the given value. |
| Instance:WaitForChild | Instance | Returns the child of the Instance with the given name. If the child does not exist, it will yield the current thread until it does. |
Inherited from Object
| Name | Type / Returns | Description |
|---|---|---|
| Object:GetPropertyChangedSignal | RBXScriptSignal | Get an event that fires when a given property of the object changes. |
| Object:IsA | boolean | Returns true if an object's class matches or inherits from a given class. |
| Object:isA | boolean |
Events
Inherited from BasePart
| Name | Type / Returns | Description |
|---|---|---|
| BasePart.LocalSimulationTouched | Fires on the local client when another part comes in contact with this part. | |
| BasePart.OutfitChanged | Fires when the part's appearance changes due to a Shirt. | |
| BasePart.StoppedTouching | Fires on the local client when a part stops touching another part. | |
| BasePart.Touched | Fires when a part touches another part as a result of physical movement. | |
| BasePart.TouchEnded | Fires when a part stops touching another part as a result of physical movement. |
Inherited from Instance
| Name | Type / Returns | Description |
|---|---|---|
| Instance.AncestryChanged | Fires when the Instance.Parent property of this object or one of its ancestors is changed. | |
| Instance.AttributeChanged | Fires whenever an attribute is changed on the Instance. | |
| Instance.ChildAdded | Fires after an object is parented to this Instance. | |
| Instance.childAdded | ||
| Instance.ChildRemoved | Fires after a child is removed from this Instance. | |
| Instance.DescendantAdded | Fires after a descendant is added to the Instance. | |
| Instance.DescendantRemoving | Fires immediately before a descendant of the Instance is removed. | |
| Instance.Destroying | Fires immediately before (or is deferred until after) the instance is destroyed via Instance:Destroy(). | |
| Instance.StyledPropertiesChanged | Fires whenever any style property is changed on the instance, including when a property is set to nil. |
Inherited from Object
| Name | Type / Returns | Description |
|---|---|---|
| Object.Changed | Fires immediately after a property of the object changes, with some limitations. |