Skip to main content

Potato Chips (World Edition) v1.0 Instructions

Installation Instructions

Dependencies

This gimmick depends on the following package. Make sure you have installed them before you install this gimmick.


Adding Potato Chips to the Scene

Drag Potato Chips (World).unitypackage into Project window, click the Import button on the dialog to import the package to your avatar project:

Import

After that, drag Assets/LuiStudio/Potato Chips (World)/Potato Chips.prefab from the product window into the scene.

Installation Instructions end

Feature Introduction

This Udon gimmick implements movement, opening, eating and pouring mechanics for potato chips in VRChat worlds:

Movement

  • Uses VRC Pickup component for grab/throw mechanics
  • Uses VRC Object Sync for instance synchronization

Opening

Three opening methods implemented: PC, VR, and simplified mode using VRC Pickup's Use function.

The VRC Pickup method is called "Easy Unpack Mode".

  • PC Method - PC players see an upward slider UI:

    PC_Unpack

    Drag the arrow to the top to open.

  • VR Method - VR players see two outward arrows:

    VR_Unpack

    Grab both arrows and pull apart to open. Configure activation distance via Drag Distance.

  • Easy Unpack Mode - When enabled via Easy Unpack Mode, hides the above UIs and allows opening by using the pickup (mouse click/trigger).

After opening, the bag's collider shrinks to 1/4 size to avoid interference with chips. With Use Gravity enabled, inverted bags may sink - this is normal.

Eating

Contains 12 chips controlled by Chip scripts. Chip meshes are hidden by default. After opening, players can take chips which become visible when grabbed. Releasing (mouse click/trigger) plays a crunch sound, hides the chip, and makes it unavailable for 3 seconds before resetting. Adjust via Reset Duration.

Pouring

Enabled via Enable Pouring. When holding the bag inverted beyond Pour Angle, chips will pour out.

End of Feature Introduction

Configuration Guide

Configuration reference for the potato chips' Udon scripts.

Hierarchy structure:

Hierarchy

IDQuick JumpDescription
1Potato ChipsRoot object
2Potato Chips BagBag parent object
3Armature_Chips_Bag...Bag model
4UnpackOpening logic parent
5VR and Child ObjectsVR opening logic
6PC and Child ObjectsPC opening logic
7ParticlesPouring particle effects
8AudioOpening sound effects
9Chips_ParentChips parent constraint source
10ChipsChips parent object

1. Potato Chips

Root GameObject containing the main Potato Chips Udon script and driving Animator.

1. Potato Chips Udon Script

Inspector UI:

Potato_Chips_Script

Is Unpacked

Tracks whether the bag is opened.

ValueNotes
Typebool
Accessprivate
SyncSync
GetterYesGetIsUnpacked: bool
SetterYesUnpack: void, Pack: void
CallbackNo

Callbacks may be added in future versions

Easy Unpack Mode

Enables simplified opening via VRC Pickup Use function.

ValueNotes
Typebool
Accessprivate
SyncLocal
GetterYesGetIsEasyUnpackMode: bool
SetterYesEnableEasyUnpackMode: void, DisableEasyUnpackMode: void
CallbackNo

Callbacks may be added in future versions

Easy Unpack Mode Use Text

"Use" prompt text when Easy Unpack Mode is enabled.

ValueNotes
Typestring
Accessprivate
SyncLocal
GetterYesGetEasyUnpackModeUseText: string
SetterYesEnableEasyUnpackMode: void, DisableEasyUnpackMode: void
CallbackNo

Callbacks may be added in future versions

Enable Pouring

Enables chip pouring mechanics.

ValueNotes
Typebool
Accessprivate
SyncSync
GetterNo
SetterYesEnablePouring: bool, DisablePouring: bool
CallbackNo

Callbacks may be added in future versions

Pour Angle

Angle threshold for pouring (degrees from vertical).

ValueNotes
Typefloat
Accesspublic
SyncLocal
GetterNo
SetterNo
CallbackNo

Callbacks may be added in future versions

Potato Chips Bag
Warning

Do not modify unless you know what you're doing

Reference to Potato Chips Bag Udon Script.

Use Gravity

Controls whether gravity affects the bag.

ValueNotes
Typebool
Accessprivate
SyncLocal
GetterYesGetChipsBagPhysicSettings: bool[]
SetterNo
CallbackNo

Currently initialization-only. Contact LuiStudio for modification requests.

Is Kinematic

Controls whether physics affects the bag.

ValueNotes
Typebool
Accessprivate
SyncLocal
GetterYesGetChipsBagPhysicSettings: bool[]
SetterNo
CallbackNo

Currently initialization-only. Contact LuiStudio for modification requests.


2. Potato Chips Bag

This GameObject is the parent object for the potato chips bag model, opening logic, pouring particles, audio components, and chip constraints. It contains the Potato Chips Bag Udon script which communicates with both the Potato Chips Udon Script and Unpack Controller Udon Script.

The object also includes VRC Pickup, VRC Object Sync, Rigidbody, and Box Collider components.

1. Potato Chips Bag Udon Script

Inspector UI:

Potato_Chips_Bag_Script

Potato Chips

Reference to the Potato Chips Udon Script. Updates object visibility states when initialization occurs or when Easy Unpack Mode is modified.

Warning

Do not modify unless you know what you're doing

Unpack Controller

Reference to the Unpack Controller Udon Script. When opening requests are made, this script bubbles the call up to Potato Chips Udon Script for verification.

Warning

Do not modify unless you know what you're doing


4. Unpack

Parent object for PC/VR opening mechanics, containing the Unpack Controller Udon Script which requests bag opening when conditions are met. Hides relevant child objects when Easy Unpack Mode is active.

1. Unpack Controller Udon Script

Inspector UI:

Unpack_Controller_Script

Unpack Transform VR

Reference transform for VR opening mode. Disabled when Easy Unpack Mode is active.

Warning

Do not modify unless you know what you're doing

Unpack Transform PC

Reference transform for PC opening mode. Disabled when Easy Unpack Mode is active.

Warning

Do not modify unless you know what you're doing

Potato Chips Bag

Reference to Potato Chips Bag Udon Script. Calls its Unpack public function when opening conditions are met.

Warning

Do not modify unless you know what you're doing


5. VR and Child Objects

Enabled when in VR opening mode. Contains no components itself.

Unpack_Grab_1 and Unpack_Grab_2

Contains the Unpack Grab Udon Script which determines if VR opening conditions are met and requests opening.

Also includes VRC Pickup, Rigidbody, and Sphere Collider components.

Child objects are directional indicator models using lilToon shader's Distance Fade feature for proximity-based visibility.

1. Unpack Grab Udon Script

Determines opening conditions based on movement distance via VRC Pickup, then calls the corresponding function in Unpack Controller Udon Script.

Inspector UI:

Unpack_Grab_Script

Unpack Controller

Reference to Unpack Controller Udon Script. Calls its functions when opening conditions are met.

Warning

Do not modify unless you know what you're doing

Drag Distance

Required pull distance (in meters) to activate opening.

ValueNotes
Typefloat
Accessprivate
SyncLocal

6. PC and Child Objects

Enabled when in PC opening mode. Child object is an upward slider UI - dragging to the top calls opening functions.

Since UI can't gradually fade like VR mode objects, this includes an Unpack PCUI Display Udon Script for distance-based visibility that always faces the local player.

1. Unpack PCUI Display Udon Script

Controls UI Canvas visibility within specified distances while maintaining player-facing orientation.

Inspector UI:

Unpack_PCUI_Display_Script

Ui Canvas

Reference to the UI Canvas Transform being controlled.

Warning

Do not modify unless you know what you're doing

Show Distance

Visibility range (meters). UI hides beyond this distance.

ValueNotes
Typefloat
Accessprivate
SyncLocal

10. Chips

Parent object for individual chip GameObjects. Contains a Parent Constraint component to make it constraint to the Potato Chips Bag.

Chip_1 etc.

Parent object for individual chips, enabled after opening. Children include the chip model (Mesh) and eating sound (Audio).

Contains a Chip Udon Script controlling activation/deactivation and sound playback.

Also includes VRC Pickup, VRC Object Sync, Rigidbody, and Sphere Collider components for player interaction.

1. Chip Udon Script

Controls chip visibility when grabbed, sound playback when released, and reset mechanics after specified duration.

Inspector UI:

Chip_Script

Mesh Transform

Reference to the chip's Mesh Transform for visibility control.

Warning

Do not modify unless you know what you're doing

Audio Source

Audio Source component for crunch sounds.

Warning

Do not modify unless you know what you're doing

Reset Duration

Delay (seconds) before chip resets to bag after release.

ValueNotes
Typefloat
Accessprivate
SyncLocal
End of Configuration Guide