为什么当我改变方向时玩家的腿会移动(Roblox)

时间:2020-03-21 02:31:46

标签: roblox

当我更改右腿的Z轴的方向时,它将在随机方向上移动。我不知道该怎么做。 Example Image我的右腿移动代码:

local function animLegs()
        local switch = false
        if switch == false then
            oy = oy + .1
            rleg.Orientation = Vector3.new(rleg.Orientation.X,rleg.Orientation.Z,oy)
            if rleg.Orientation.Y == .8 then
                switch = true
                print("switch")
            end
        elseif switch == true then
            oy = oy - .1
            rleg.Orientation = Vector3.new(rleg.Orientation.X,oy,rleg.Orientation.Z)
            if rleg.Orientation.Y == .5 then
                switch = false
                print("switch2")
            end
        end 
        wait(.001)
    end

我在做什么错了?

0 个答案:

没有答案