Skip to content

Using Pendulum Chains for Simple Physics

Written by lunazera

VNyan's pendulum chain system is pretty flexible for adding simple dynamics to your model. You can even use them to drive rotation transforms of GameObjects on your avatar. This can be convenient to use to add single-axis movement to accessories.

Glasses physics example

For example, say your avatar has glasses attached to a bone called "GlassesRoot" and you wanted to introduce some jiggle physics to them. You would only want this movement in a single axis, otherwise your glasses would fly off your head instead of just moving up and down. Springbones or Magica Cloth wouldn't be helpful here because they don't have options to constrain movement in that way.

To do this in VNyan, you could make a new pendulum chain (3-4 links long), create a new output and set Bone # to 3 or 4, "GlassesRoot" under the GameObject, and Transform to Rotation X.

We want the movement of the Head bone to drive this chain. In a Node Graph you can create a timer loop that reads the Head Bone's transformation to parameters, using Transform to Param. Under the chain's input values, create a new Parameter type input for a parameter for the Head's Y position, with a multiplier around 10-15 and Effect set to Pos X.

You can copy and paste the graph codeblock below for the timer loop setup.

VNYANGRAPH:UEceSGVhZCBQb3NpdGlvbiBUcmFja2VyHjAeMB4tMjk2HzEyHjUxNB81MjccYlgeVGltZXIeUEceMx4tMjAwHy0xNzQedGltZXJOYW1lH0hlYWRUcmFja2VyHTJEHlNldFRpbWVyHlBHHjceODcfLTExOR50aW1lck5hbWUfSGVhZFRyYWNrZXIfc2Vjb25kcx8wHWp1HlRyYW5zZm9ybVBhcmFtHlBHHjUeNzcfLTM1OB5wYXJhbXgfSGVhZFgfcGFyYW15H0hlYWRZH3BhcmFteh9IZWFkWh9ib25lHzEwH3RyYW5zZm9ybR8zHU5sHkFwcFN0YXJ0HlBHHjAeLTE4NB8tNjceHDJEMB9ObDAeMkQwH2JYMB5qdTAfYlgwHQ

Tongue physics example

Another idea for how to use this is to add tongue physics to your model, given that your tongue is rigged with bones.