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

How to tilt a part towards its velocity?

Asked by 7 years ago

I tried a bunch of things and I don't get the result I expected. Here is one of them:

local plr = game.Players.LocalPlayer
local rs = game:GetService("RunService").RenderStepped

rs:connect(function()
    if plr.Character then
        local chr = plr.Character
        local hrp = chr:WaitForChild("HumanoidRootPart")
        local tor = chr:WaitForChild("Torso")
        local rj = hrp:WaitForChild("RootJoint")
        if chr:FindFirstChild("Animate") then
            chr.Animate:remove()
            for _,c in pairs(chr:WaitForChild("Humanoid"):GetPlayingAnimationTracks()) do
                c:Stop()
            end
        end
        rj.C0 = CFrame.new()
        rj.C1 = CFrame.new()
        local vel = tor.Velocity
        rj.C1 = CFrame.new()*CFrame.Angles(-math.rad(vel.Y),-math.rad(vel.Z),-math.rad(vel.X))
    end
end)

So basically I want to tilt the torso towards where its moving and its rotation, so if its facing forwards and you're moving forwards, you'll tilt forwards. But sadly I don't know how to do this :|.

0
If you're animating, couldn't you tilt the torso forward? EzraNehemiah_TF2 3552 — 7y
0
If you're using the animation plugin just tile the torso forward and bam. EzraNehemiah_TF2 3552 — 7y
0
bruh, that isnt what i want User#10445 15 — 7y

Answer this question