imported>Orangestar No edit summary  | 
				m Woops. Works now.  | 
				||
| (14 intermediate revisions by 8 users not shown) | |||
| Line 1: | Line 1: | ||
<languages></languages>  | <languages></languages>  | ||
<translate>  | <translate>  | ||
[[File:CommonSpawnAreaComponent.webp|alt=A photo of the common spawn area component and it's fields in the inspector.|thumb|The CommonSpawnArea component as seen in the [[Scene Inspector]]]]  | |||
The '''CommonSpawnArea''' component is a [[User|user]] spawner that can take a range from a [[:Category:Components:Transform:Point Generators|Point Generator Type]].  | |||
|  | |||
|  | |||
<  | If there is no '''CommonSpawnArea''' in the [[World]], the user will spawn at the coordinates <code>0, 0, 0</code>.  | ||
{{Table ComponentFields  | {{Table ComponentFields  | ||
|SpawnPointGenerator|IPointGenerator|A [[:Category:Components:Transform:Point Generators|  | |SpawnPointGenerator|IPointGenerator|A [[:Category:Components:Transform:Point Generators|Point Generator Type]] component. This determines which points the spawn area will use for spawning new users.  | ||
|FloorPointRay|Float3|    | |FloorPointRay|Float3| Shoots a ray from the slot containing this component and trys to detect a floor  | ||
|OtherUserCheckRadius|Float|A minimum of how far away other users must be before a spawn point generated by SpawnPointGenerator is valid.    | |OtherUserCheckRadius|Float|A minimum of how far away other users must be before a spawn point generated by SpawnPointGenerator is valid.  | ||
|ParentUser|Bool|If true, newly-spawned users will be parented to the slot holding this component.    | |ParentUser|Bool|If true, newly-spawned users will be parented to the slot holding this component.  | ||
|OrientUser|Bool|If true, newly-spawned users will be oriented towards the Z- axis that the slot holding this component is facing.    | |OrientUser|Bool|If true, newly-spawned users will be oriented towards the Z- axis that the slot holding this component is facing.  | ||
|ScaleUser|Bool|If true, newly-spawned users will be scaled to be the same scale as the slot holding this component. This can cause issues with parenting, so take care.    | |ScaleUser|Bool|If true, newly-spawned users will be scaled to be the same scale as the slot holding this component. This can cause issues with parenting, so take care.  | ||
|Capacity|Int|The maximum number of users that can be spawned in the slot holding this component at any given time. A value of -1 makes the maximum unlimited.    | |Capacity|Int|The maximum number of users that can be spawned in the slot holding this component at any given time. A value of -1 makes the maximum unlimited.  | ||
|BaseWeight|Float|    | |BaseWeight|Float| The chance this spawner will be used to spawn users. The higher the number, the more likely the chance.  | ||
|PositionNode|UserNode|    | |PositionNode|'''[[Component:UserRoot#UserNode|UserRoot.UserNode]]'''|TypeAdv8=true| Positions the user based on this body node.  | ||
|RotationNode|UserNode|    | |RotationNode|'''[[Component:UserRoot#UserNode|UserRoot.UserNode]]'''|TypeAdv9=true| Rotates the user based on this body node.  | ||
|ParentOverride|Slot| Where to place users instead of under this component's Slot.  | |||
}}  | }}  | ||
<!--T:4-->  | <!--T:4-->  | ||
==   | == Usage ==  | ||
Unlike other user spawner components, the CommonSpawnArea component allows you to use a   | Unlike other user spawner components, the '''CommonSpawnArea''' component allows you to use a [[:Category:Components:Transform:Point Generators|Point Generator Type]] component to define an arbitrary area in which users can spawn from. This gives you more granular control over a spawn area than [[Component:SpawnArc|SpawnArc]].  | ||
{{Note|When multiple '''CommonSpawnArea''' components are present within a world, [[Resonite]] will pick one at random, based on the <code>BaseWeight</code> property.|information}}  | |||
<!--T:5-->  | <!--T:5-->  | ||
== Examples ==  | == Examples ==  | ||
How to fix one of the more common problems with users spawning in, users falling through the flaw before the world's colliders have loaded.  | |||
<youtube>uUeOsFWap_U</youtube>  | |||
[[File:Grid World Template Spawn.webp|alt=A glowing spawn circle next to an inspector showing it's hierarchy.|thumb|The CommonSpawnArea as seen in the Grid world template.]]  | |||
== Related Components ==  | == Related Components ==  | ||
* [[SimpleUserSpawn   | * [[Component:SimpleUserSpawn|SimpleUserSpawn]]  | ||
* [[SpawnArc   | * [[Component:SpawnArc|SpawnArc]]  | ||
* [[Component:PointGenerator|PointGenerator]]  | |||
</translate>  | </translate>  | ||
[[Category:Components{{#translation:}}|  | [[Category:Components{{#translation:}}|Common Spawn Area]]  | ||
[[Category:Components:Users{{#translation:}}|Common Spawn Area]]  | |||
[[Category:Components:Users{{#translation:}}|  | |||
Latest revision as of 12:22, 18 October 2025

The CommonSpawnArea component is a user spawner that can take a range from a Point Generator Type.
If there is no CommonSpawnArea in the World, the user will spawn at the coordinates 0, 0, 0.
| Name | Type | Description | 
|---|---|---|
persistent
 | 
Bool | Determines whether or not this item will be saved to the server. | 
UpdateOrder
 | 
Int | Controls the order in which this component is updated. | 
Enabled
 | 
Bool | Controls whether or not this component is enabled. Some components stop their functionality when this field is disabled, but some don't. | 
SpawnPointGenerator
 | 
IPointGenerator | A Point Generator Type component. This determines which points the spawn area will use for spawning new users. | 
FloorPointRay
 | 
Float3 | Shoots a ray from the slot containing this component and trys to detect a floor | 
OtherUserCheckRadius
 | 
Float | A minimum of how far away other users must be before a spawn point generated by SpawnPointGenerator is valid. | 
ParentUser
 | 
Bool | If true, newly-spawned users will be parented to the slot holding this component. | 
OrientUser
 | 
Bool | If true, newly-spawned users will be oriented towards the Z- axis that the slot holding this component is facing. | 
ScaleUser
 | 
Bool | If true, newly-spawned users will be scaled to be the same scale as the slot holding this component. This can cause issues with parenting, so take care. | 
Capacity
 | 
Int | The maximum number of users that can be spawned in the slot holding this component at any given time. A value of -1 makes the maximum unlimited. | 
BaseWeight
 | 
Float | The chance this spawner will be used to spawn users. The higher the number, the more likely the chance. | 
PositionNode
 | 
UserRoot.UserNode | Positions the user based on this body node. | 
RotationNode
 | 
UserRoot.UserNode | Rotates the user based on this body node. | 
ParentOverride
 | 
Slot | Where to place users instead of under this component's Slot. | 
Usage
Unlike other user spawner components, the CommonSpawnArea component allows you to use a Point Generator Type component to define an arbitrary area in which users can spawn from. This gives you more granular control over a spawn area than SpawnArc.
Examples
How to fix one of the more common problems with users spawning in, users falling through the flaw before the world's colliders have loaded.
