Skip to main content

Managers

Managers in Verza's SDK provide a powerful way to interact with various world elements, control the flow of your scripts, and build complex interactions. They are used to perform actions, retrieve information, and modify the game state according to your requirements.

EngineManager

Methods

MethodDescription
engine.connectServerConnects a websocket server script to a Verza server instance.
engine.connectClientConnects a client script to a Verza server instance.
engine.restartServerRestarts the server instance.
engine.setForwardMessagesEnables or disables message forwarding to scripts.
engine.requestResourcesCheckRequests a resources check.
engine.areResourcesReadyChecks if the resources are ready.
engine.destroyCleans up and releases engine resources.

Properties

NameTypeDescription
engine.networkNetworkManagerManages network connections and communication.
engine.apiApiManagerHandles Verza's requests and responses.
engine.uiUIManagerManages UI elements and interactions.
engine.chatChatManagerHandles in-game chat functionality.
engine.commandsCommandsManagerManages command registration and execution.
engine.cameraCameraManagerControls camera settings and transitions.
engine.streamerStreamerManagerManages the streaming of objects and assets.
engine.worldWorldManagerControls world properties and environment settings.
engine.assetsAssetsManagerManages assets loading and caching.
engine.eventsEventsManagerEngine's events manager.
engine.paramsEngineParamsHolds engine configuration parameters.
engine.localPlayerPlayerManagerA reference to the local player object.
engine.playersPlayersManagerThe manager for players.
engine.objectsObjectsManagerThe manager for objects.
engine.localPlayerIdnumberThe ID of the local player.
engine.connectedbooleanTrue if the engine is currently connected.
engine.syncedbooleanTrue if the engine is currently synced.
engine.isServerbooleanTrue if the script is running on the server.
engine.isClientbooleanTrue if the script is running on the client.
engine.chunkSizenumberThe size of the chunks used for streaming.
engine.syncPlayersbooleanIndicates if player data is being synced.
engine.syncPlayerUpdatesPrioritybooleanDetermines the priority of player updates syncing.
engine.syncPlayerUpdatesbooleanIndicates if player updates are being synced.
engine.syncPlayerControlsbooleanIndicates if player controls are being synced.
engine.syncCameraPositionbooleanIndicates if camera position is being synced.

AssetsManager

Methods

MethodDescription
assets.uploadUploads a file to Verza's servers to be used as an asset in your script.

AudioManager

Methods

MethodDescription
audio.addSoundAdd a sound to the engine.
audio.removeSoundRemove a sound from the engine.
audio.createSoundCreate a sound.
audio.createPlayerSoundCreate a sound attached to a player.
audio.createObjectSoundCreate a sound attached to an object.
audio.playSoundPlay a sound and automatically dispose of it when it's done playing.
audio.playSoundAtPositionPlay a sound and automatically dispose of it when it's done playing at a specific position.

SoundManager

Properties

NameTypeDescription
sound.idstringSound ID.
sound.namestringSound name.

Methods

MethodDescription
sound.playPlay the sound.
sound.pausePause the sound.
sound.resumeResume the sound.
sound.stopStop the sound.
sound.setVolumeSet the sound volume.
sound.setPlaybackRateSet the sound playback rate.
sound.setLoopSet the sound loop.
sound.setLoopStartSet the sound loop start.
sound.setLoopEndSet the sound loop end.
sound.setPositionSet the sound position.
sound.setMinDistanceSet the sound minimum distance to start to fade out.
sound.setMaxDistanceSet the sound maximum distance to fade out.
sound.setRolloffFactorSet the sound rolloff factor.
sound.setOptionsSet the sound options.
sound.destroyDestroy the sound.

EffectsManager

Methods

MethodDescription
effects.createParticlesCreate a particle effect.
effects.createPlayerParticlesCreate a particle effect attached to a player.
effects.createObjectParticlesCreate a particle effect attached to an object.
effects.playParticlesPlay a particle effect.
effects.playParticlesAtPositionPlay a particle effect at a specific position.

ParticlesManager

Properties

NameTypeDescription
particles.idstringParticle effect ID.

Methods

MethodDescription
particles.playPlay the particle effect.
particles.pausePause the particle effect.
particles.stopStop the particle effect.
particles.resumeResume the particle effect.
particles.setPositionSet the particle effect position.
particles.setOptionsSet the particle effect options.
particles.destroyDestroy the particle effect.

ProximityActionManager

Properties

NameTypeDescription
proximityAction.idstringProximity action ID.

Methods

MethodDescription
onListen for proximity action triggered events.
offStop listening for proximity action triggered events.
proximityAction.destroyDestroy the proximity action.

AnimationsManager

Methods

MethodDescription
animations.addAnimationsAdds animations to the engine.
animations.getAnimationGets an animation by id.
animations.getAnimationsGets all animations.
animations.removeAnimationRemoves an animation by id.

CameraManager

Properties

NameTypeDescription
camera.cameraPerspectiveCameraThe camera object.
camera.positionVector3The position of the camera.
camera.rotationEulerThe rotation of the camera.
camera.quaternionQuaternionThe quaternion of the camera.

ClothesManager

Methods

MethodDescription
clothes.addClotheAdds a clothe item to the engine.
clothes.removeClotheRemoves a clothe item from the engine.
clothes.addSkinMaskAdds a skin mask to the engine.
clothes.removeSkinMaskRemoves a skin mask from the engine.

ChatManager

Methods

MethodDescription
chat.setEnabledEnables or disables the chat for the server.
chat.escapeTextEscapes special characters in a message so that they are displayed correctly in the chat.
chat.sendMessageToAllSends a message to all players in the server.
chat.sendMessageToSends a message to a specific player in the server.

UIManager

Properties

NameTypeDescription
ui.interfacesstring[]An array of the interfaces currently being displayed on the UI

Methods

MethodDescription
ui.showShows the UI.
ui.hideHides the UI.
ui.setPropsSets the size properties of the UI.
ui.addInterfaceAdds an interface to the UI.
ui.removeInterfaceRemoves an interface from the UI.
ui.hasInterfaceChecks whether the interface has been added to UI.
ui.toggleInterfaceToggles whether an interface is added or not.
ui.showCursorShows the cursor.
ui.hideCursorHides the cursor.
ui.toggleCursorToggles the locked status of the cursor.
ui.showIndicatorShows a loading indicator on the UI.
ui.hideIndicatorHides the loading indicator on the UI.
ui.addToolbarAdds a toolbar to the UI.
ui.removeToolbarRemoves a toolbar from the UI.
ui.addMainToolbarItemAdds a toolbar item to the main toolbar.
ui.removeMainToolbarItemRemoves a toolbar item from the main toolbar.
ui.isCursorShownChecks whether the cursor is shown.
ui.removeAllInterfacesRemoves all interfaces from the UI.
ui.openUrlOpens a URL in a new tab.
ui.goToServerGoes to a server.
ui.isSystemMenuChecks whether the current interface is any System Menu.
ui.isPlayersListChecks whether the current interface is the Players List.
ui.isOptionsMenuChecks whether the current interface is the Options Menu.
ui.isServerMenuChecks whether the current interface is the Server Menu.
ui.isComponentShownChecks whether a UI component is shown.
ui.toggleComponentToggles the visibility of a UI component.
ui.showComponentShows a UI component.
ui.hideComponentHides a UI component.

InputManager

Properties

NameTypeDescription
input.cursorLockbooleanA boolean that indicates whether or not the cursor is locked to the game window.
input.isActiveInputbooleanA boolean that indicates whether or not a text input field is currently active for the player.
input.activeInputHTMLInputElementThe HTML input element that is currently active relative to the script.

CommandsManager

Properties

NameTypeDescription
commandsMap<string, Command>The list of registered commands.
noAccessMessagestringThe message displayed when a user tries to execute a command but doesn't have permission to do so.

Methods

MethodDescription
registerRegisters a command or action.
unregisterUnregisters a command or action.

EntitiesManager

Properties

NameTypeDescription
entities.typeEntityTypeThe type of entity managed by the entity manager.
entities.entitiesEntityManager[]An array containing all the entity managers for the specified entity type.
entities.entitiesMapMap<ID, EntityManager>A map of entity managers indexed by their respective entity IDs.
entities.streamedMap<ID, EntityManager>A map of entity managers for entities that are currently being streamed to the player.
entities.eventsEventsManagerAn instance of the EventsManager class used to register and manage events for the specified entity type.

Methods

MethodDescription
entities.isChecks whether an entity with the specified ID exists.
entities.getRetrieves the entity with the specified ID. Returns null if the entity does not exist.

NetworkManager

Properties

MethodDescription
network.serverServerDtoAn object containing information about the server the player is currently connected to.

Methods

MethodDescription
network.emitToPlayerEmit an event to a specific player on the server.
network.emitToPlayersEmit an event to all players on the server.
network.emitToPlayersWithAccessEmit an event to players with specific access on the server.
network.emitToPlayersWithRolesEmit an event to players with specific roles on the server.
network.emitToScriptsEmit an event to all scripts on the server.
network.emitToServerEmit an event to the server.
network.onPlayerEventRegister a listener function to be called when a player event is emitted.
network.offPlayerEventUnregister a listener function previously registered with onPlayerEvent.
network.onServerEventRegister a listener function to be called when a server event is emitted.
network.offServerEventUnregister a listener function previously registered with onServerEvent.
network.onScriptEventRegister a listener function to be called when a script event is emitted.
network.offScriptEventUnregister a listener function previously registered with onScriptEvent.

ObjectsManager

Properties

NameTypeDescription
objects.entitiesObjectManager[]An array containing all the object managers.
objects.entitiesMapMap<ID, ObjectManager>A map of ObjectManager indexed by their respective object IDs.
objects.streamedMap<ID, ObjectManager>A map of ObjectManager for entities that are currently being streamed to the player.
objects.eventsEventsManagerAn instance of the ObjectManager class used to register and manage events.
objects.editingObjectObjectManagerA reference to the object manager for the object currently being edited, or null if no object is being edited.

Methods

MethodDescription
objects.createCreates a new object with the specified properties.
objects.resolveRetrieves an object by its ID and returns a reference to the corresponding object manager.
objects.editBegins editing the specified object.
objects.cancelEditCancels editing of the current object.
objects.setEditSnapsEnables or disables snap offset while editing objects.
objects.setEditAxesEnables or disables the display of translation, rotation and scaling axes while editing objects.

ObjectManager

Properties

NameTypeDescription
object.idstringThe ID of the object.
object.vars[Map<string, any>]A map of variables that can be used to store local data for the object.
object.visiblestringWhether the object is visible or not.
object.attachedToObjectManagerThe object that this object is attached to, or null if this object is not attached to anything.
object.attachedEntitiesSet<EntityManager>The entities attached to the object, represented as a set of EntityManager instances.
object.objectTypeObjectTypeThe type of the object.
object.locationObject3DThe object's position, rotation, and scale.
object.positionVector3The object's position.
object.rotationQuaternionThe object's rotation.
object.quaternionQuaternionThe object's quaternion.
object.scaleVector3The object's scale.
object.worldLocationPromise<Object3D>A promise that resolves to the world location of the object.
object.worldPositionVector3The world position of the object.
object.worldQuaternionQuaternionThe world quaternion of the object.
object.worldScaleVector3The world scale of the object.
object.permanentbooleanWhether the object is permanent or not.
object.remotebooleanWhether the object is remote or not.
object.parentIdstringThe ID of the parent object.
object.parentObjectManagerThe parent object of this object, or null if this object has no parent.
object.childrenSet<ObjectManager>The child objects of this object, represented as a set of ObjectManager instances.
object.userDataObjectUserDataCustom user data attached to the object.
object.propsObjectPropsThe properties of the object, based on its type.
object.dataObjectDataThe data of the object.
object.supportsCollisionbooleanWhether the object supports collision or not.
object.collisionEntityCollisionTypeThe collision type of the object.
object.colliderEntityColliderTypeThe collider type of the object.
object.supportsShadowsbooleanWhether the object supports shadows or not.
object.shadowsbooleanWhether the object casts shadows or not.
object.supportsBloombooleanWhether the object supports bloom or not.
object.bloombooleanWhether the object has bloom or not.
object.sensorbooleanWhether the object is a sensor or not.
object.massnumberThe object's mass, used in physics calculations.
object.frictionnumberThe object's friction, used in physics calculations.
object.restitutionnumberThe object's restitution, used in physics calculations.
object.enabledRotationsBoolean3ArrayWhether the object's rotations are enabled or not.
object.enabledTranslationsBoolean3ArrayWhether the object's translations are enabled or not.
object.soundSoundManagerThe object's sound manager when used the sound property (React SDK only).
object.particlesParticlesManagerThe object's particles manager when used the particles property (React SDK only).
object.proximityActionProximityActionManagerThe object's proximity action manager when used the proximityAction property. (React SDK only)

Methods

MethodDescription
object.attachAttaches an entity to the object.
object.detachDetaches an entity from the object.
object.detachFromParentDetaches the object from its parent.
object.setPositionSet the position of the object.
object.setRotationSet the rotation of the object.
object.setScaleSet the scale of the object.
object.setVisibleSet whether or not the object is visible.
object.setDataUpdate data for the object.
object.setPropsUpdates type-specific properties for an object.
object.setPositionFromWorldSpaceSet the position of the object in world space.
object.setRotationFromWorldSpaceSet the rotation of the object in world space.
object.setShadowsEnable or disable shadows for the object.
object.setBloomEnable or disable bloom for the object.
object.setCollisionSet the collision type of the object.
object.setColliderSet the collider type of the object.
object.setMassSet the mass of the object.
object.setFrictionSets the friction of the physics object.
object.setRestitutionSets the restitution of the physics object.
object.setEnabledRotationsSets which rotations are enabled for the physics object.
object.setEnabledTranslationsSets which translations are enabled for the physics object.
object.computeBoundingBoxCompute the bounding box of the object.
object.computeWorldBoundingBoxCompute the world bounding box of the object.
object.rerenderForces an object to re-render.
object.isStreamedChecks if an object is currently being streamed.
object.waitForStreamWaits for an object to finish streaming.
object.setLinearVelocitySets the linear velocity of the object.
object.setAngularVelocitySets the angular velocity of the object.
object.applyImpulseApplies an impulse to the object.
object.addTorqueAdds torque to the object.
object.applyTorqueImpulseApplies an impulse torque to the object.
object.startTransitionsStarts all active transitions for the object.
object.startTransitionStarts a transition for the object.
object.clearTransitionsClears all active transitions for the object.
object.createSoundCreates a sound attached to the object.
object.createParticlesCreates a particle effect attached to the object.
object.createProximityActionCreates a proximity action attached to the object.
object.toDataConverts an object to its corresponding data representation.
object.cloneCreates a new object by cloning an existing object with the same properties.
object.setHelperEnables or disables the helper for the object.
object.syncSynchronizes an object's properties between the server and the client.
object.saveSaves an object to the Verza servers, making it permanent.
object.saveVolatileSame as object.save but with a delay.
object.deleteDestroys and deletes an object from Verza servers (only for permanent objects).
object.destroyDestroys an object.

PlayersManager

Properties

NameTypeDescription
players.entitiesPlayerManager[]An array containing all the player managers.
players.entitiesMapMap<ID, PlayerManager>A map of PlayerManager indexed by their respective player IDs.
players.streamedMap<ID, PlayerManager>A map of PlayerManager for players that are currently being streamed to the player.
players.eventsEventsManagerAn instance of the EventsManager class used to register and manage events.

Methods

MethodDescription
players.createCreates a detached player entity.
players.forEachInChunkIterates for each player in specified chunk.
players.setNametagsDistanceSets the nametags distance for all players.
players.setStreamerDistance Sets the streamer distance for all players.

PlayerManager

Properties

NameTypeDescription
player.idnumberThe player's ID.
player.vars[Map<string, any>]A map of variables that can be used to store local data for the player.
player.visiblestringWhether the player is visible or not.
player.attachedToObjectManagerThe object that this player is attached to, or null if this player is not attached to anything.
player.attachedEntitiesSet<EntityManager>The entities attached to the player, represented as a set of EntityManager instances.
player.isAdminbooleanWhether the player is an admin or not.
player.locationObject3DThe player's position and rotation.
player.positionVector3The player's position.
player.rotationQuaternionThe player's rotation.
player.quaternionQuaternionThe player's quaternion.
player.velocityVector3The player's velocity vector.
player.worldPositionVector3The player's world position.
player.worldRotationQuaternionThe player's world rotation.
player.worldQuaternionQuaternionThe player's world quaternion.
player.namestringThe player's name.
player.statePlayerStateThe player's current state.
player.rolesstring[]The roles assigned to the player.
player.controls PlayerControlsThe player's controls.
player.isMovingControlbooleanWhether the player's movement controls are active.
player.onGroundbooleanWhether the player is currently on the ground.
player.cameraPlayerCameraManagerThe player's camera manager.
player.voicechatPlayerVoicechatManagerThe player's voicechat manager.

Methods

MethodDescription
player.attachAttaches an entity to the player.
player.detachDetaches an entity from the player.
player.detachFromParentDetaches the player from its parent.
player.setNameSets the player's name.
player.setNametagColorSets the player's nametag color.
player.setDimensionSets the player's dimension.
player.setPositionSets the player's position.
player.setRotationSets the player's rotation.
player.getFacingAngleGets the player's facing angle.
player.setFacingAngleSets the player's facing angle.
player.setCameraBehindSets the player's camera to be behind them.
player.sendMessageSends a message to the player.
player.setMovementsSets the player's movement controls.
player.setTranslationsSets the player's translation axes.
player.setLinearVelocitySets the player's linear velocity.
player.setClimbAngleSets the player's maximum climb angle.
player.setVisibleSet whether or not the player is visible.
player.sendSuccessNotificationSends a success notification to the player.
player.sendErrorNotificationSends an error notification to the player.
player.hasAccessChecks if the player has access to a certain command or action.
player.hasRoleChecks if the player has a role.
player.addRoleAdds a role to the player.
player.removeRoleRemoves a role from the player.
player.addClothesAdds clothes to the player.
player.getClothesGets the player's clothes.
player.removeClothesRemoves clothes from the player.
player.playAnimationPlays an animation on the player.
player.stopAnimationStops an animation on the player.
player.stopAnimationsStops all animations on the player.
player.pauseAnimationPauses an animation on the player.
player.resumeAnimationResumes an animation on the player.
player.banBans the player.
player.unbanUnbans the player.
player.getBanStatusGets the player's ban status.
player.kickKicks the player.
player.setChatEnabledSets the player's chat enabled status.
player.createSoundCreates a sound attached to the player.
player.createParticlesCreates a particle effect attached to the player.
player.createProximityActionCreates a proximity action attached to the player.
player.camera.setFovSets the camera fov for the player.
player.camera.setModeSets the camera mode for the player.
player.camera.startTransitionsStarts transitions for the camera.
player.camera.startTransitionStarts a transition for the camera.
player.camera.stopTransitionsStops transitions for the camera.
player.camera.setPositionSets the position of the camera.
player.voicechat.setPlayerToPlayerModeSets the voicechat mode to player to player.
player.voicechat.enableChannelEnables a voicechat channel.
player.voicechat.disableChannelDisables a voicechat channel.
player.voicechat.setMutedSets the player's muted status.
player.voicechat.setDistanceSets the player's voicechat distance.

StorageManager

Methods

MethodDescription
storage.getPersistentStoreGets a persistent store.
storage.getMemoryStoreGets a memory store.

PersistentStoreManager

Methods

MethodDescription
store.setSets a value in the store.
store.getGets a value from the store.
store.deleteDeletes a value from the store.
store.getListGets a list from the store.

MemoryStoreManager

Methods

MethodDescription
store.setSets a value in the store.
store.getGets a value from the store.
store.deleteDeletes a value from the store.

VoicechatManager

Methods

MethodDescription
voicechat.setEnabledSets the global voicechat status.
voicechat.setModeSets the global voicechat mode.
voicechat.setDistanceSets the global voicechat distance.

WorldManager

Methods

MethodDescription
world.getTimeGets the current time of day.
world.setTimeSets the current time of day.
world.setTimeModeSets the time mode.
world.setTimeCycleDurationSets how long a day/night cycle lasts in seconds.
world.setTimezoneSets the timezone.
world.setHemisphereLightColorSets the color of the hemisphere light.
world.setHemisphereLightGroundColorSets the color of the ground hemisphere light.
world.setHemisphereLightIntensitySets the intensity of the hemisphere light.
world.setGlobalLightColorSets the color of the global light.
world.setGlobalLightIntensitySets the intensity of the global light.
world.setGlobalLightAzimuthSets the azimuth of the global light.
world.setInteriorModeEnabledEnable or disable the interior mode.
world.setSkyboxSets the current skybox.
world.setWeatherSets the current weather.
world.setMoonPhaseSets the current moon phase.
world.setSkyManualModeEnabledSets whether the sky transitions are manual or automatic according to the time of day.
world.setViewportRenderSets the world viewport render mode.
world.createProximityActionCreates a proximity action.
world.createPlayerProximityActionCreates a proximity action attached to a player.
world.createObjectProximityActionCreates a proximity action attached to an object.
world.setFogEnabledSets the fog status.
world.setFogColorSets the fog color.
world.setFogDensitySets the fog density.

RaycasterManager

Methods

MethodDescription
raycaster.raycastScreenPointCasts a ray from a point on the screen and returns the hit information.
raycaster.raycastPointCasts a ray from a origin and a direction in the world and returns the hit information.
raycaster.raycastPointsCasts rays from two positions in the world and returns hit information.

Misc

Methods

MethodDescription
createControllerManagerCreates a controller manager.