Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do you make an animation with just using a script only? Not with ROBLOX Plugin.

Asked by
T1mes 230 Moderation Voter
8 years ago
Edited 8 years ago

I don't want to use animations from ROBLOX Animation plugin. I want a way you can use on sb (Script Builder) with just scripts. Is there any way like this?

1
It's recommended you use the animation plugin. The animations are faster, and are easier to make. If you were to make it by script, you would have to set the positions of every single frame Volodymyr2004 293 — 8y

1 answer

Log in to vote
0
Answered by 8 years ago
Edited 8 years ago

Using linear interpolation, you can make an animation smoothly, and more easily. You also have to use jointInstances to move the body parts

local Player = game.Players.LocalPlayer
local Character = Player.Character
local leftArm = Character.Torso['Left Shoulder'] -- there's also Neck(Head), Character.HumanoidRootPart(Torso), Right Shoulder(Right arm), Left Hip(Left leg), and right hip (right leg)

local Run = game:GetService('RunService')
local spd = .1 --how fast to get to the goal (1 being the fastest)

Run.RenderStepped:connect(function()
    leftArm.C0 = leftArm.C0:lerp(CFrame.new(x, y, z) * CFrame.Angles(math.rad(x), math.rad(y), math.rad(z)), spd)
end)

if you're looking for more smooth back and forth animation

Run.RenderStepped:connect(function()
    leftArm.C0 = leftArm.C0:lerp(CFrame.new(x, y, z) * CFrame.Angles(math.rad(x * math.sin(tick())), math.rad(y * math.sin(tick())), math.rad(z * math.sin(tick()))), spd)
end) -- can be math.cos if you'd like, and doesn't have to be on all axis's

and don't forget to remove roblox's default animations, to do this simply use the code below

Character.Humanoid:ClearAllChildren()
Character.Animate:Remove()
0
How is this easier? OldPalHappy 1477 — 8y
0
It's definitely easy if you know simple trigonometry and algebra. I often made animations way more quicker than with the animation editor, and the editor animations looked unrealstic, annoying, and buggy. tentergram 10 — 8y
0
y e e t thanks man TheRealPotatoChips 793 — 4y
Ad

Answer this question