React to PhysBone grabs, poses and stretches
When to use this
Section titled “When to use this”Use a PhysBone trigger when the avatar should react to its own PhysBones: the eyes widen while someone pulls the tail, or ears drop while they are grabbed. The trigger reads a PhysBone that is already on the avatar.
To react to a hand that touches or comes near a spot, see React to touch.
This needs Advanced mode, the default.
-
In the Hierarchy, select the object that holds your AvatarDoc component.
-
In the inspector's toolbar, press + Trigger. On a narrow inspector, it sits under + More.
You should now see a trigger named New Trigger, selected under Triggers in the tree.
-
In the trigger's panel, type a name into Name, such as Hair pull, and press Enter.
-
Set When to PhysBone.
-
Press the small circle at the right end of PhysBone and pick the PhysBone. The list shows only the PhysBones of this avatar.
-
In Event, pick what the trigger waits for:
- Grabbed: while someone holds the PhysBone.
- Posed: while the PhysBone stays in a pose someone left it in.
- Bent past, Stretched past or Squished past: once the bend, the stretch or the squish goes past Amount.
-
For the three events that go past an amount, set Amount, from 0 to 1. A new trigger starts at 0.5.
In the picture, 1 is When, 2 Mode, 3 PhysBone, 4 Event and 5 Amount.
-
In the panel, press + Add effect, then Blendshapes, and pick the shape the trigger moves, such as Eye_Wide. You can also drag objects onto Objects.
With Mode set to Hold, the default, the effect is on while the event is true and stops when it ends.
Flip a toggle with each grab
Section titled “Flip a toggle with each grab”Flip mode turns a menu toggle on or off each time the event starts, for example each time someone grabs the tail.
-
In the trigger's panel, set Mode to Flip.
You should now see a Toggle field under Mode, and the effect sections are gone.
-
In Toggle, pick the toggle to flip.
The flip sets the toggle itself, so its button in the menu, its saved state and other players all follow it, the same as a press in the menu.
What AvatarDoc builds
Section titled “What AvatarDoc builds”The trigger reads the PhysBone's own parameter. If the PhysBone has none, AvatarDoc gives it one in the avatar it uploads, never in your scene. Several triggers on the same PhysBone share that parameter. A PhysBone trigger costs no synced bits.
Who may grab or pose the PhysBone is set on the PhysBone component itself. AvatarDoc does not change it.
Check it worked
Section titled “Check it worked”- In the trigger's panel, press On in the Scene preview row to see the effect in the Scene view. A trigger in Flip mode shows Simulate touch instead, which flips the toggle's preview.
- In Play mode, the VRChat SDK lets you grab a PhysBone with the mouse in the Game view. With Gesture Manager, see Your first toggle for Play mode.
The preview cannot grab a PhysBone. Only Play mode or VRChat shows that the event really fires.
If it does not work
Section titled “If it does not work”- Nothing happens when the PhysBone is grabbed: the PhysBone does not let that player grab it, or the trigger points at another PhysBone. Check the grab settings on the PhysBone component.
- Stretched past or Squished past never fires: the PhysBone cannot stretch or squish in its own settings, or Amount is higher than it ever gets. Lower the amount.
- An error says the trigger cannot flip its toggle: no toggle is picked in Toggle. See the message.
Related
Section titled “Related”- Touch triggers describes every PhysBone setting.
- Link effects to another toggle or a parameter adds more conditions with + And and + Or.
- A touch or PhysBone trigger never fires in Troubleshooting.
Docs for AvatarDoc 0.7.1