VRC_ObjectPool.TryToSpawn() causes client crash in certain uses
complete
Yodokoro
VRChat client crashes with following steps.
- VRC_ObjectPool.TryToSpawn() calls in Interact() like the code below:
[SerializeField] private VRC.SDK3.Components.VRCObjectPool _pool; // Instance substituted in inspector
public override void Interact()
{
Networking.SetOwner(Networking.LocalPlayer, _pool.gameObject);
_pool.TryToSpawn();
}
- Build this, and enter it with 2 players (Player_A, Player_B for this time).
- Player A interacts this object and spawn all objects.
- Player B interacts this object.
- Player B crashes.
It will happenes even if SetOwner() and TryToSpawn() called in different frame.
I guess this was have to be just return null from TryToSpawn().
Reproduction world:
Log In
orels
bug fixed
This has been fixed in one of the latest releases.
orels
bug fix in progress
orels
Merged in a post:
VRC Object Pool causes late joiners to crash
BoatFloater
A client hang occurs when a player has joined after an object pool is emptied of all available objects, becomes the owner of the object pool, and tries to spawn a new object.
The player must join after the object pool is already empty.
The client hangs indefinitely on the call to VRCObjectPool.TryToSpawn()
--
I was able to replicate this for master just by creating an object pool with 0 objects in it and then using the TryToSpawn() method with no other code.
PlayerBush001
Whaddageek
Yup, saw this happen just today in one of my worlds as well.
PlayerBush001
This is not quite correct. In my testing, it only happens if the player has never interacted with the pool before. If two players take turns summoning in objects, it seems to work fine.
Made a short 1:27min video showcasing the problem and what I did to cause it: https://youtu.be/fbsZwktvdyM
Did a tutorial on using an object pool, which this is based off. Dunno if this has been a long time problem, but it's pretty bad