how to make a sword swing
1st make your sword
2nd Open Animation Editor: Go to the Plugins tab and open the Animation Editor Create Rig: Select a dummy (R6 or R15) to animate Keyframes: Set up the animation by creating a starting position, a mid-swing point (around 0.06-0.09s), and an ending position Set Priority: Set the animation priority to Action (crucial so the swing overrides walking animations).
3. Scripting the Swing
- Add Animation Object: Inside the Tool, create an
Animationobject, name it "SwingAnim," and paste your published animation ID into theAnimationIdproperty. - Add Script: Add a
Scriptinside the tool to handle the input and animation. - Sample Script:
local tool = script.Parent local anim = tool:WaitForChild("SwingAnim") local loadedAnim tool.Activated:Connect(function() local character = tool.Parent local humanoid = character:FindFirstChild("Humanoid") if humanoid then loadedAnim = humanoid:LoadAnimation(anim) loadedAnim:Play() end end)
No comments:
Post a Comment