【问题标题】:ROBLOX - How would I move the player 8 studs, for 20 miliseconds smoothly (so tweening), in the direction the player is facing?ROBLOX - 我如何将玩家 8 个螺柱平滑地移动 20 毫秒(如此补间),朝着玩家所面对的方向?
【发布时间】:2020-11-15 17:42:46
【问题描述】:

我如何将玩家 8 个螺柱沿玩家所面对的方向平滑移动 20 毫秒(如此过渡)?

script.Parent.Activated:Connect(function()
    --[This is because this is a localscript in a tool]
end)

【问题讨论】:

    标签: roblox


    【解决方案1】:
    local isGliding = false;
    
    script.Parent.Activated:Connect(function()
        isGliding = not isGliding;
        local char = script.Parent.Parent; --The tool gets inside of the char when activated
        local humanoidRootPart = char:WaitForChild("HumanoidRootPart");
        coroutine.wrap(function()
        while true do
           humanoidRootPart.Positon += humanoidRootPart.LookVector * 8;
           wait(0.3)
           if isGliding == false then 
                 break;
             end
           end
        end)()
    end)
    

    大概是这样的。这应该在工具下的一个 ServerScript 中。

    【讨论】:

    • Players.{my username}.Backpack.Uppercut.Script:7: LookVector 不是 Part "Workspace.{my username}.HumanoidRootPart" 的有效成员
    • 不好意思,改成.CFrame.LookVector
    猜你喜欢
    • 1970-01-01
    • 2014-06-21
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-11-12
    • 1970-01-01
    • 2021-06-22
    相关资源
    最近更新 更多