Component:CommonSpawnArea: Difference between revisions

From Resonite Wiki
document behaviour when having multiples
Style, Added links, this is no longer a stub.
Line 3: Line 3:
[[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]]]]
[[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]]]]


== Introduction ==
The '''CommonSpawnArea''' component is a [[User|user]] spawner that can take a range from a [[Component:PointGenerator|PointGenerator]].


The CommonSpawnArea component is a user spawner that can take a range from a PointGenerator.
== Usage ==
{{Table ComponentFields
{{Table ComponentFields
|SpawnPointGenerator|IPointGenerator|A [[:Category:Components:Transform:Point Generators|PointGenerator]] component. This determines which points the spawn area will use for spawning new users.
|SpawnPointGenerator|IPointGenerator|A [[:Category:Components:Transform:Point Generators|PointGenerator]] component. This determines which points the spawn area will use for spawning new users.
Line 21: Line 19:


<!--T:4-->
<!--T:4-->
== Behavior ==
== Usage ==
Unlike other user spawner components, the CommonSpawnArea component allows you to use a PointGenerator component to define an arbitrary area in which users can spawn from. This gives you more granular control over a spawn area than [[SpawnArc (Component)|SpawnArc]].
Unlike other user spawner components, the '''CommonSpawnArea''' component allows you to use a [[Component:PointGenerator|PointGenerator]] component to define an arbitrary area in which users can spawn from. This gives you more granular control over a spawn area than [[SpawnArc (Component)|SpawnArc]].


When multiple CommonSpawnArea are present within a world, Resonite will pick one at random, based on the <code>BaseWeight</code> property.
{{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-->
Line 33: Line 31:
* [[SimpleUserSpawn (Component)|SimpleUserSpawn]]
* [[SimpleUserSpawn (Component)|SimpleUserSpawn]]
* [[SpawnArc (Component)|SpawnArc]]
* [[SpawnArc (Component)|SpawnArc]]
* [[Component:PointGenerator|PointGenerator]]
</translate>
</translate>
[[Category:Components{{#translation:}}|Common Spawn Area]]
[[Category:Components{{#translation:}}|Common Spawn Area]]
[[Category:ComponentStubs]]
[[Category:Components:Users{{#translation:}}|Common Spawn Area]]
[[Category:Components:Users{{#translation:}}|Common Spawn Area]]

Revision as of 04:42, 27 September 2024

A photo of the common spawn area component and it's fields in the inspector.
The CommonSpawnArea component as seen in the Scene Inspector

The CommonSpawnArea component is a user spawner that can take a range from a PointGenerator.

Fields
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.
SpawnPointGenerator IPointGenerator A PointGenerator component. This determines which points the spawn area will use for spawning new users.
FloorPointRay Float3
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
PositionNode UserNode
RotationNode UserNode

Usage

Unlike other user spawner components, the CommonSpawnArea component allows you to use a PointGenerator component to define an arbitrary area in which users can spawn from. This gives you more granular control over a spawn area than SpawnArc.

When multiple CommonSpawnArea components are present within a world, Resonite will pick one at random, based on the BaseWeight property.

Examples

A glowing spawn circle next to an inspector showing it's hierarchy.
The CommonSpawnArea as seen in the Grid world template.

Related Components