Map is live: https://vrchat.com/home/world/wrld_04bba9b6-cc9d-4abe-a44c-1d1046f8ce16
Mechanism to do something similar to a VRCPickup, but much, much faster and able to easily handle 1,000+ objects per map and still hit 100+ FPS. Note that unlike normal object sync, it does not fast sync objects that are inactive and then collided with. But for basic object position control, kinematic or otherwise, this is a fast and reliable option.
- Add the BrokeredUpdateManager object to your scene, it doesn't matter where.
- Note: You must use exactly
BrokeredUpdateManager
name for the manager object. - Add the BrokeredSync object to your scene.
To make more objects able to be sync'd, on your object you want brokered sync on,
- "Add Component" "VRC Pickup"
- "Add Component" "BrokeredSync"
NOTE: This relies upon BrokeredUpdateManager, which is included in the unitypackage. You will need a BrokeredUpdateManager component somewhere in your scene.
NOTE: This is for kinematic objects, not objects which can roll around. Though you may have some limited success, I have not yet made this disable objects once moving for the master.
To use the Sync Manager, after being added to your world, you could do something like this:
using BrokeredUpdates;
...
void Start()
{
GameObject.Find( "BrokeredUpdateManager" ).GetComponent<BrokeredUpdateManager>()._RegisterSnailUpdate( this );
}
...
public void _SnailUpdate()
{
// This gets called sometimes.
}
BrokeredSync allows Udon scripts to:
- Call _GetIncrementingID() to get a unique ID, just a global counter.
- Call
_RegisterSubscription( this )
/_UnregisterSubscription( this )
in order to get '_BrokeredUpdate()` called every frame during the period between both calls. - Call
_RegisterSlowUpdate( this )
/_UnregisterSlowUpdate( this )
in order to get_SlowUpdate()
called every several frames. (Between the two calls.) All slow updates are called round-robin. - Call
_RegisterSnailUpdate( this )
/_UnregisterSnailUpdate( this )
in order to get_SnailUpdate()
called every several frames. (Between the two calls.) All snail updates are called round-robin, but with a delay.
Note SlowObjectSync functionality is internal - and used by the brokered sync object.
- Install VRC Worlds SDK 3.0
- Install Udon Sharp
- Install CyanEmu
- Install AudioLink
- Install TXL Player
- Further investigate the quirks of not getting deserialization events.
- Try more traditionally attaching the object to a player when it's moving instead of just smoothing the lerp {though I personally prefer the smoothed lerp that I'm doing now to player attachment}.
- Handle disabling motion when object actually stops moving for it's master.