Overview
The client-side portion of Utility Objectify is responsible for managing the behavior, lifecycle, and communication of object instances rendered on the player's machine.
It handles:
Creating and destroying local script instances tied to entities
Managing plugins and lifecycle hooks
Handling remote procedure calls (RPC) from server to client
This section provides a high-level overview of what happens on the client and how to work with it.
π§ Core Responsibilities
β
1. Object Instantiation
When an entity is rendered (OnSpawn), the library:
Looks up all scripts registered to the entityβs model (via the @model(modelName, abstract?) or @plugin(pluginName) decorators)
Creates a new class instance and binds it to the entity
Initializes the lifecycle: OnAwake, OnSpawn, AfterSpawn
β When an entity is unrendered (OnDestroy):
All bound script instances are destroyed
The lifecycle method OnDestroy is called
Memory and state tracking is cleared
π§ Script Registration
π§© Plugin System
π‘ RPC Client β Server
π Entity-Based RPC (via self.server or self.client)
π§© Global RPC (via Server.<method> or Client.<method>)
π State Change Handling
π£ Event Handling
@event("eventName", ignoreRendering?)
π¦ Object Registry: Entities
Entities
π Utility Functions
Last updated