CyanPlayerObjectPool
CyanPlayerObjectPool copied to clipboard
Automate pool size using VRCWorld
Its possible to automate the pool size assignment by pulling the world size directly from the VRC Api
A function like this can get the current scenes VRCWorld into a variable
private static async Task GetWorld()
{
//get the pipeline manager by finding the PipelineManager component in the current scene
PipelineManager pipelineManager = GameObject.FindObjectOfType<PipelineManager>();
var worldId = pipelineManager.blueprintId;
//if its a new world (no id), skip
if (worldId != null)
{
//get the world from the api
world = await VRCApi.GetWorld(worldId, true);
}
}
And then you can query the max capacity by doing world.Capacity