Skip to content

Proposal: Stackable objects of same type in the same SnapDropZone #1503

Description

@bkensey

Overview

I'm proposing the addition of new functionality to VRTK_SnapDropZone to accommodate the stacking of identical VRTK_InteractableObject based items.

This will be useful for me in particular in building an RPG style inventory, but I can imagine it being useful in other contexts too (eg. tracking grenade count in an FPS chest-mounted inventory a la Onward)

Code In Progress

  • Made rough working changes to VRTK_SnapDropZone to tally the number of objects being stacked
  • Added a (very) rough test to determine whether an interactable object is the same kind already snapped to an SDZ.
  • Tweaked VRTK_InteractableObject to add a new "stackable" property

Demo

capture

For discussion

  • Is this functionality generalized enough to merit inclusion into VRTK?
  • What is the best way to perform interactable object type comparison (tags, subclass comparison, id variables?)
  • Should all of the proposed functionality, like the item counter, be added to VRTK_SnapDropZone or should it be added to a subclassed prefab instead?
  • What are the implications for communication between SDZs. Users might want to prevent multiple stacks of the same object, meaning that an SDZ would have to check in with each of the other SDZs in its group to see if they should receive the interactable object instead. Perhaps a VRTK_SnapDropZoneGroup component is worth considering.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions