YaScene¶
YaScene
manages how to spawn and destroy an entity in the scene.Functions¶
YaEntity GetDefaultSpawnPoint()¶
SERVER ONLY
ReturnsThe default spawn point entity
Gets the default spawn point.
Array<YaEntity> GetAllRespawnPoints()¶
SERVER ONLY
ReturnsA list of respawn point entities
Returns all respawn points.
YaEntity GetClosestRespawnPoint(number playerId)¶
SERVER ONLY
ReturnsThe closest respawn point entity
Gets the respawn point closest to the player.
playerId
The unique identifier of the player
YaEntity Spawn(string name, float3 globalPosition)¶
SERVER ONLY
ReturnsThe spawned entity
Spawns an entity with a given name and at a specific position.
name
The name of the spawned entityglobalPosition
The world space position of the spawned entity
YaEntity Spawn(string name, float3 globalPosition, float3 globalRotation)¶
SERVER ONLY
ReturnsThe spawned entity
Spawns an entity at a desired position and with a specific name and rotation.
name
The name of the spawned entityglobalPosition
The world space position of the spawned entityglobalRotation
The spawned entity's rotation in world space as Euler angles in degrees
YaEntity Spawn(string name, float3 globalPosition, float3 globalRotation, float3 globalScale)¶
SERVER ONLY
ReturnsThe spawned entity
Spawns an entity at a desired position and with a specific name, rotation, and scale.
name
The name of the spawned entityglobalPosition
The world space position of the spawned entityglobalRotation
The spawned entity's rotation in world space as Euler angles in degreesglobalScale
The spawned entity's scale in world space regardless of the entity's original scale
void Destroy(YaEntity destroyTargetEntity)¶
SERVER ONLY
Destroys a target entity.
destroyTargetEntity
The entity to destroy
boolean CheckObjectExist(YaEntity entity)¶
ReturnsTrue if the entity exists
Checks if the entity exists.
entity
The entity to check