Raise an arm with a limb chain
Updated
While R is held, a script eases the right arm’s upper and lower joints up, found by role with the humanoid rig’s chain.
Click the scene, then hold R to raise the right arm and release it to lower it. Drag to orbit the camera, scroll to zoom.
Raise an arm with a limb chain
#pragma lifecycle(update)
const skeleton = self.parent.getComponent(SkeletonComponent);let amount = 0;
function update(dt) { const arm = skeleton.rig?.chain('rightArm'); if (!arm) return; const [upper, lower] = arm;
const wanted = Input.keyboard.isKeyPressed(Key.R) ? 1 : 0; amount += (wanted - amount) * Math.min(1, dt * 8); if (amount < 0.001) return; // let the clip pose the arm
upper.rotation.z = -amount * 1.4; lower.rotation.z = -amount * 0.6;}How it works
Section titled “How it works”The script is explained step by step in Raise an arm with a limb chain.
Open it in XR Creator
Section titled “Open it in XR Creator”Download the project file below, then import it in XR Hub with Projects › New › Import, as described in Projects and templates. It opens in XR Creator with the same scene you see running above, each script already attached to its Behavior entity. From there you can edit the scripts, adjust components and their props, preview your changes, and deploy the result as a world of your own.
RaiseHand.xrproj