Skip to main content

Test scenarios

Networked code isn't done until it passes every scenario that applies to it, in Play mode with at least two remote players.

Before you start​

  1. Check that Unity and UdonSharp compiled without console errors.
  2. Enter Play mode in your world, or in NetSimTest.unity from the Test World sample.
  3. Add two remote players.
  4. Use Normal for realistic timing, or Perfect when a check must give the same result every time.

"You" means the local player. "Bob" is a remote player. The method names are from NetSimApi.

Sync and events​

#ScenarioHowPass when
1You write a synced valueInteract(obj)The log shows the send, and remote state equals local state
2Non-owner writeBob takes ownership, then you write without SetOwnerA "not the owner" warning appears. Fix: take ownership first.
3Remote write reaches youTakeOwnership, then SendStateOnDeserialization runs and the visuals update, not only the field
4Late joinUntick Local Player Is Master, then PlayState is correct after the snapshot. Nothing relies on Start seeing synced values.
5Owner and Others eventsBob owns it, you send bothNeither runs on your client. All does.
6Remote event and CallingPlayerSendEvent as BobThe handler runs, and authorization checks behave
7Event spamSend more than 5 events in one frameThe code tolerates delayed delivery
8Size limitFill strings and arrays to realistic maximumsNo OnPostSerialization success=false. Continuous sync stays under 200 B.

Ownership and leaving​

#ScenarioHowPass when
9Ownership raceYou and Bob both take ownership and write within the latencyThe final state is consistent, with nothing stuck or duplicated
10Denied ownershipOnOwnershipRequest returns false. Test both directions.The requester doesn't keep ownership, and your code doesn't assume SetOwner succeeds
11Master leavesMasterLeaves() with a remote masterObjects migrate, and master-only logic continues on the new master
12Owner leavesBob owns it, then Leave("Bob")Ownership falls back, and nothing waits for Bob

Pickups and bad networks​

#ScenarioHowPass when
13Pickup theftBob uses Grab while you hold itTheft or DisallowTheft behaves as designed
14Bad networkPreset("Bad")Continuous visuals tolerate loss, and manual state still converges

PlayerObjects​

#ScenarioHowPass when
15A copy for each playerAdd playersEach player has a <name> [id] copy in every world. Others change it only through Owner events.
16Request to the ownerSendEvent an Owner event from Bob to your copyYour handler checks CallingPlayer, then writes. A call from yourself is rejected.
17A player with a PlayerObject leavesLeave("Bob")Bob's copy is destroyed, and totals such as a leaderboard refresh without a dead reference

Unsynced pickups​

#ScenarioHowPass when
18Pickup without VRCObjectSyncGrab it yourself, and also use Grab as BobIt moves only on the holder's client. Compare it with an ObjectSync pickup.

Working with PlayerObjects​

Use a VRCPlayerObject when data belongs to one player, such as a score or settings.

  • Find a player's copy with Networking.FindComponentInPlayerObjects(player, templateComponent).
  • Never call SetOwner on a PlayerObject. Its player owns it permanently.
  • To change another player's data, send their copy an Owner event.

The NetSimTestPlayerCard and NetSimTestLeaderboard samples show this pattern.

Reporting results​

When you say that networked code works, list the scenario numbers you ran and the preset, with the relevant [ClientSimNet] log lines. List the others as untested.

The simulator isn't VRChat. Check its known limits, and test in real clients before publishing.