{"id":"1legendrblx/puppet-master","name":"puppet-master","scope":"1legendrblx","platform":"roblox","description":"Front-end module that allows you to use simple parts to dynamically control complex parts and models.","version":"1.2.1","latest":"1.2.1","versions":["1.0.0","1.1.0","1.2.0","1.2.1"],"license":"MIT","licenseRating":"safe","licenseCaveats":["The package archive does not include its license text; the license is declared in its manifest metadata."],"licenseVerified":false,"dependencies":{},"integrity":"53559c44bcdca996b1d6d2a887d2146b48b5a7809bdb080824104186a3cb9e05","likes":0,"downloads":0,"install":"forest install 1legendrblx/puppet-master","url":"https://forest.dev/p/roblox/1legendrblx/puppet-master","files":"https://api.forest.dev/ai/package/roblox/1legendrblx/puppet-master/files","readme":"# Puppet Master\r\n\r\nPuppet Master is a simple front-end module that allows objects (`puppet`) to smoothly interpolate to another object or a (`master`) This module can be useful for setting up smooth client visuals without making a huge mess.\r\n\r\n# Good Use Cases:\r\n- Make a player's pet float around their head and do a spin every few seconds\r\n- Have AI models replicated on the client as a `puppet` that follows the server's `master` part\r\n- Shoot a magic projectile straight forwards and have a puppet make a wavy trail behind it\r\n\r\n<img width=\"540\" height=\"540\" alt=\"puppetMasterIcon\" src=\"https://github.com/user-attachments/assets/f6eefab5-dccf-407f-80d7-a5ba7c999e5b\" />\r\n\r\n## Usage\r\nTo construct a PuppetMaster class, you'll need a `master: Model | BasePart` a `puppet: Model | BasePart` and optionally settings `settings: Settings`\r\n\r\nAfter constructing a `PuppetMaster` with `.new()`, you can freely `:Play(runtimeSignal: RBXScriptConnection?)` or `:Pause()` the connection.\r\n\r\n- By default the connection uses a `RunService.PostSimulation` signal, but this can be customized by sending a signal through the `runtimeSignal: RBXScriptConnection?` parameter in `:Play(runtimeSignal: RBXScriptConnection?)`\r\n\r\n### Example\r\n```lua\r\nlocal PuppetMaster = PuppetMaster.new(masterPart, puppetPart, {\r\n\t\tstyle = PuppetMaster.StyleModules.Linear, -- what style the puppet follows the master in (use PuppetMaster.StyleModules in the settings)\r\n\t\tturnSpeed = 20, -- gets / 100 and used as the alpha during lookVector interpolation\r\n\t\tlerpSpeed = 5, -- gets / 100 and used as the alpha during position interpolation\r\n\t\tsnapThreshold = 0.01, -- the maximum distance before the puppet copies the master's position instead of interpolating\r\n\t\t\r\n\t\t--[[\r\n\t\t\t-- lookVectorClamping: Vector2 --\r\n\t\t\tnumbers range from 0 to 1.\r\n\t\t\t1 - looks fully to focusTarget\r\n\t\t\t0.5 - can look 180 degrees forward from where master is looking\r\n\t\t\t0 - looks fully where master is looking\r\n\r\n\t\t\tX - applies to horizontal axis\r\n\t\t\tY - applies to vertical axis\r\n\t\t]]\r\n\t\tlookVectorClamping = Vector2.new(1, 0.2),\r\n\r\n\t\t-- // specific variables for styles\r\n\t\tspringSettings = {\r\n\t\t\tspeed = 15, -- affects the frequency of waves\r\n\t\t\tfadeIn = 4, -- level of gradual decline of spring strength when close to master\r\n\t\t\tstrength = 1, -- maximum vertex\r\n\t\t},\r\n\r\n\t\tdebug = {\r\n\t\t\tdebugTrails = false,\r\n\t\t},\r\n\t})\r\n\r\n-- puppet will look at this instance, when nil puppet follows the masters lookDir\r\nPuppetMaster:AddFocusTarget(workspace:WaitForChild(\"FocusTarget\"))\r\n\r\n-- puppet will be offset by 4 studs above the master, function retruns Vector3Value\r\nlocal idleOffset = testPuppet:AddOffset(Vector3.yAxis * 4, 1, false)\r\n\r\nPuppetMaster:Play(RunService.Heartbeat)\r\n```\r\n","readmeTruncated":false}