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

Would This Be a Proper Way of Making a “Get up Animation”?

Asked by 3 years ago

I'm sort of a noob when it comes to animating in Roblox. I've been working on this first-person get-up animation for a game intro, and I'm wondering if this is a efficient way to go? The code was quickly made for the purpose of testing (in short, it's just a concept.)

What it looks like when running: https://i.gyazo.com/5fe430db5cb1da7f68b8f727fafc3798.gif

Code:

local camera = game.Workspace.CurrentCamera
local Player = game.Players.LocalPlayer
local Dummy = game.Workspace.Dummy
local ANIAMTION = Instance.new("Animation", Dummy)
local Getup2 = nil
ANIAMTION.AnimationId = "rbxassetid://7466818713"
Player.CameraMode = Enum.CameraMode.LockFirstPerson
wait(5)
local Track = Dummy.Humanoid:LoadAnimation(ANIAMTION)
Track:Play() --looking around
Track:AdjustSpeed(0.5)
Getup2 = Track:GetMarkerReachedSignal("Getup2"):Connect(function()
    Track:AdjustSpeed(0)
    ANIAMTION.AnimationId = "rbxassetid://7467814762"
    Track = Dummy.Humanoid:LoadAnimation(ANIAMTION)
    Track:Play() --getting up
    Track:AdjustSpeed(0.5)
    Getup2:Disconnect()
    Getup2 = nil
end)
camera.CameraType = Enum.CameraType.Scriptable
camera.CFrame = Dummy.Head.CFrame

game:GetService("RunService").Heartbeat:Connect(function() --first person look
    camera.CFrame = Dummy.Head.CFrame   
end)

Answer this question