I originally put this together in 2022 as a small technical demonstration to test out the capabilities of Roblox Studio's Video to Motion Capture (Mocap) feature.
I also created this specific repository as a testing ground for one of my other open-source side projects, xlx2tree.
Tip
xlx2tree is a command-line utility I built that parses monolithic .rbxlx XML place files and extracts them into a structured directory hierarchy. This makes it infinitely easier to track Roblox places on version control systems like Git, as each RbxInstance is split into its own independent directory or file.
Here are a few clips I recorded during development:
scene_to_wireframe.mp4
wireframe_solo.mp4
third_person_cam.mp4
Note
Depending on your markdown viewer or browser, you might need to open the raw .mp4 files inside the .media/ directory directly if the embedded videos above do not render correctly.
The interaction logic is driven by a combination of server-side state management and client-side camera manipulation.
Located within the vending machine model (Workspace/VendingMachine.MeshPart/ProximityPrompt/Script), this script handles the core interaction sequence when a player triggers the ProximityPrompt:
- Camera Event: Fires a
RemoteEvent(CameraManipulate) to the client to shift the camera focus to the player's head for a cinematic view. - Animation Sequences: Loads and plays three sequential mocap animations:
CoinIn: The character inserts a coin.Pickup: The character retrieves the dispensed item.Drink: The character consumes the item.
- Weld Constraints: Clones a Cola tool from
ReplicatedStorage, welds it to the character'sLeftHandusingCFramemath, and manages its lifecycle through the animation keyframes. - State Restoration: Restores the player's mobility, grants health (+20 HP), signals the client to reset the camera view, and destroys the welded item upon completion.
Located in StarterGui/ManipulateCamera.LocalScript, this script listens for the CameraManipulate remote event. It toggles the workspace.CurrentCamera.CameraSubject between the default Humanoid and a specified character part (the Head), switching to a dynamic camera ONLY during the animation sequence.
If you just want to grab the place file and load it into Studio without dealing with all this, check out the Releases page on this repository. You'll find the original .rbxl and .rbxlx files available for download!