{"id":"bigfootpp/sync","name":"sync","scope":"bigfootpp","platform":"roblox","description":"A lightweight animation and motion framework for Luau.","version":"0.1.0","latest":"0.1.0","versions":["0.1.0"],"license":"MIT","licenseRating":"safe","licenseCaveats":[],"licenseVerified":true,"dependencies":{},"integrity":"e6c644559d991161315c3e56382b72965064375bbba604bd0171b827402d84fc","likes":0,"downloads":0,"install":"forest install bigfootpp/sync","url":"https://forest.dev/p/roblox/bigfootpp/sync","files":"https://api.forest.dev/ai/package/roblox/bigfootpp/sync/files","readme":"# Sync\n\nA lightweight animation and motion framework for Luau and Roblox.\n\n---\n\n## Installation\n\nAdd this to your `wally.toml` dependencies:\n\n```toml\nSync = \"bigfootpp/sync@0.1.0\"\n```\n\n---\n\n## Quick Start\n\n### 1. Wrapping Animations\n\n```luau\nlocal Sync = require(ReplicatedStorage.Packages.Sync)\n\nlocal myTrack = animator:LoadAnimation(myAnimationInstance)\nlocal animation = Sync.Animation(myTrack)\n\n-- Play with optional fadeTime, weight, speed\nanimation:Play(0.2, 1.0, 1.0)\n```\n\n### 2. State Machine & Transitions\n\nCreate states, register them to a state manager, and run a state machine:\n\n```luau\nlocal Sync = require(ReplicatedStorage.Packages.Sync)\n\n-- Initialize Manager and States\nlocal manager = Sync.StateManager()\nlocal idleState = Sync.State(\"Idle\")\nlocal runState = Sync.State(\"Run\")\n\nmanager:RegisterState(idleState)\nmanager:RegisterState(runState)\n\n-- Setup transitions\nlocal isRunning = false\nlocal runTransition = Sync.State.Transition.CreateConditionnalTransition(runState, function()\n    return isRunning\nend)\nmanager:AddTransitions(\"Idle\", runTransition)\n\n-- Run State Machine\nlocal stateMachine = Sync.StateMachine(manager, \"Idle\")\nmanager:Play()\n\n-- Tick in your run loop\nRunService.Heartbeat:Connect(function(dt)\n    stateMachine:Update(dt)\nend)\n```\n\n### 3. 1D Blendspace\n\nBlend between multiple animations dynamically using a single parameter:\n\n```luau\nlocal Sync = require(ReplicatedStorage.Packages.Sync)\n\nlocal blendSpace = Sync.BlendSpace1D({\n    { x = 0, animation = idleAnimation },\n    { x = 8, animation = walkAnimation },\n    { x = 16, animation = runAnimation }\n}, 0.1)\n\nblendSpace:Play()\n\n-- Dynamically adjust speed based on character velocity\nRunService.Heartbeat:Connect(function()\n    local speed = character.PrimaryPart.AssemblyLinearVelocity.Magnitude\n    blendSpace:Update(speed)\nend)\n```\n","readmeTruncated":false}