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.
playerIdThe 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.
nameThe name of the spawned entityglobalPositionThe 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.
nameThe name of the spawned entityglobalPositionThe world space position of the spawned entityglobalRotationThe 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.
nameThe name of the spawned entityglobalPositionThe world space position of the spawned entityglobalRotationThe spawned entity's rotation in world space as Euler angles in degreesglobalScaleThe spawned entity's scale in world space regardless of the entity's original scale
void Destroy(YaEntity destroyTargetEntity)¶
SERVER ONLY
Destroys a target entity.
destroyTargetEntityThe entity to destroy
boolean CheckObjectExist(YaEntity entity)¶
ReturnsTrue if the entity exists
Checks if the entity exists.
entityThe entity to check