当站在砖块上时,举起双手的动画[ROBLOX]

我需要一个脚本,可以在你站在砖块上时做出一个动画。我不知道如何制作动画。我找不到一个带有我要寻找的动画的免费模型。这是我想要双手举起的预览。 [ANIMATION PREVIEW](http://i.stack.imgur.com/9k8bm.png)

你站在的砖块是

script.Parent
点赞
用户1938640
用户1938640

有两种主要的动画方式;较新的 Animations 和较旧的 Joints

这个 指南 应该能够帮助你开始学习动画。它甚至有个 视频教程

如果你想使用旧风格的 Joint 动画,像这样也许可以:

local Block = script.Parent

local function MakeFakeShoulder(Character, Side)
    local Controller = { ["Stop"] = function() end }

    local Torso = Character:findFirstChild("Torso")
    local Arm = Character:findFirstChild(Side .. " Arm")

    if not Torso or not Arm then return Controller end

    local Shoulder = Torso:findFirstChild(Side .. " Shoulder")
    if Shoulder then
        local FakeShoulder = Instance.new("ManualWeld")
        FakeShoulder.Name = "Fake " .. Side .. " Shoulder"
        FakeShoulder.C0 = CFrame.new(1.5 * (Side == "Right" and 1 or -1),0.5,0)
        FakeShoulder.C1 = CFrame.new(0,0.5,0) * CFrame.fromAxisAngle(Vector3.FromAxis(Enum.Axis.Z), math.rad(-180))
        FakeShoulder.Part0 = Torso
        FakeShoulder.Part1 = Arm
        FakeShoulder.Parent = Torso

        Shoulder.Parent = nil

        function Controller:Stop()
            Shoulder.Parent = Torso
            FakeShoulder:Destroy()
        end
    end
    return Controller
end

local function MakeFakeShoulders(Character)
    local Controller = { }

    local Right = MakeFakeShoulder(Character, "Right")
    local Left = MakeFakeShoulder(Character, "Left")

    function Controller:Stop()
        Right:Stop()
        Left:Stop()
    end

    return Controller
end

local function GetHumanoid(Part)
    if Part.Parent == nil then return nil end
    return Part.Parent:findFirstChild("Humanoid")
end

local CurrentlyTouching = { }
Block.Touched:connect(function(Part)
    local Humanoid = GetHumanoid(Part)
    if not Humanoid then return end

    CurrentlyTouching[Humanoid] = CurrentlyTouching[Humanoid] or 0
    CurrentlyTouching[Humanoid] = CurrentlyTouching[Humanoid] + 1
    if CurrentlyTouching[Humanoid] > 1 then return end

    local Controller = MakeFakeShoulders(Part.Parent)

    while CurrentlyTouching[Humanoid] > 0 do
        if GetHumanoid(Block.TouchEnded:wait()) == Humanoid then
            CurrentlyTouching[Humanoid] = CurrentlyTouching[Humanoid] - 1
        end
    end

    Controller:Stop()
end)

请注意,如果结束的触碰无法注册成功,请创建一个大小比实际部件大的无法碰撞的无形边界部件,并将脚本放在其中。

2016-08-22 00:55:36