Skip to content

TealDealMeal/InventorySystem

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

33 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Inventory System v2

Easy to use and fully works out of the box Inventory System for VRChat Worlds!

Features:

  • Fully synced (at least from my testing)
  • Works on both VR and non-VR, as well as standalone Quest
  • Create and customize any amount of holsters, which are automatically registered and attached to the player (you can change the mesh and collider to fit your preference)
  • All objects with the predetermined layers (i.e. Pickup) and VRC_Pickup script are automatically detected before the scene loads and registered, no scripts, code or manually set up arrays required (this also means you can also set up pick ups that cannot be holstered)
  • Hand collider system, only interact with holsters and it's contents if you physically touch them (VR only)
  • Plays a short haptic feedback when placing items into a holster
  • A bunch of settings, pick the ones that fit best for your project:

grafik


Requirements:


Setup:

  • Install NetworkEventCaller and follow it's How to use instructions
  • Afterwards, place the Inventory prefab into your scene, right click it in the hierarchy and click "Unpack Prefab"

  • Set up these 2 new layers (or 1 if you don't wish to use HandColliders):

grafik


  • Change the layer of both hands to use "HandCollider" (don't change the layer of children)

grafik


  • Change the layer of your holsters to use "Holster" (don't change the layer of children)
  • You can also add any amount of holsters you wish here

grafik


  • Open your "Project Settings" -> "Physics" and set up the "Layer Collision Matrix" as shown:

(Holster / Pickup, HandCollider / Holster)

grafik

(Optional: If you wish for the holster to detect VRC_Pickups that don't use the Pickup layer, you must add them here and on the "Holsterable Item Layers")

grafik


  • That's it! You should now be able to drop any pickupable object into your holsters!

(If the setup doesn't work, make sure you have set up NetworkEventCaller properly)


Performance

  • Untested, though the code shouldn't be too demanding to run at all, my concern would be bandwidth at high pick up count (prob. somewhere over 250) as we need to sync an array of player ids for every item
  • Feedback appreciated!

Current Issues:

  • For some reason, mesh renderers seem to interrupt the pick up raycast, this becomes an issue when playing in non-VR and the holster mesh is bigger than the item itself (VRChat bug)
  • If "Disable Items When Holstered" is turned on, items in the holster will no longer sync position, this is fine until the player disconnects, resetting the items back to where they were last synced

About

Easy to use and fully works out of the box Inventory System for VRChat Worlds!

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages