Hi all, I’m working on my first World and am trying to spawn props from a UI menu.
I’ve figured out the UI canvas and everything else, but I’m having trouble wrapping my mind around the actual instantiation/spawning of prop objects. I thought I had them figured out, but when testing the world with a friend, we realized neither of us could see the other one’s pickup objects.
Some research looks like I should be using object pooling, but I just can’t get it to synch right.
For example, I want to have a sort of “Bar Menu” where the player can order drinks. I want these drinks to have VRC_Pickup on them, and I’ve stored them inside some other geometry with their colliders disabled (so they don’t get flung out into space) and with their rigidbody.useGravity = false so they don’t fall into the void. I’m also setting them Inactive after the object pooler starts up.
Maybe I’m approaching this the wrong way, but, what I want is:
- Player approaches one of four “Spawn Terminals” (which have the menu)
- Player selects a drink from the menu
- The drink prop gets moved to the spawn area for that “terminal”
- The prop gets set to Active, and has its collider/useGravity enabled
As it stands currently, I’ve managed to get a single pooled object to appear (only when the Master selects it from the menu). The prop never gets its gravity enabled. Another player can grab the prop and move it, but the new position doesn’t update on the Master, and as soon as the Master grabs his version of the prop, it appears to teleport away from the other player.
Maybe I’m just not understanding how to synch or send network events correctly. I tried using the EXUR object pooler, but that doesn’t look like it handles one of my core requirements: Spawning an object from a common pool at one of many spawn points depending on which menu the player chooses