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

Someone told me to use CFrame rotation property but idk how to use please help?

Asked by 3 years ago
```lua
local TS = game:GetService("TweenService")
local rarm = workspace.arm
local root = workspace.rot
rarm.Transparency = 0.7
rarm.Orientation = Vector3.new(22.52, -135.9, -69.64)
rarm.CFrame = root.CFrame + -root.CFrame.LookVector*2 + -root.CFrame.upVector*3 + -root.CFrame.RightVector*3
rarm:ClearAllChildren()
rarm.Anchored = true
function lerp(a, b, t)
    return a + (b - a) * t
end

function cubicBezier(t, p0, p1, p2, p3)
    local l1 = lerp(p0, p1, t)
    local l2 = lerp(p1, p2, t)
    local l3 = lerp(p2, p3, t)
    local a = lerp(l1, l2, t)
    local b = lerp(l2, l3, t)
    local cubic = lerp(a, b, t)
    return cubic
end

local f1 = root.Position + -root.CFrame.LookVector*2 + -root.CFrame.upVector*3 + -root.CFrame.RightVector*3 * CFrame.Angles(math.rad(22.52),math.rad(-135.9),math.rad(-69.64))
local f2 = root.Position + root.CFrame.LookVector*.8 + -root.CFrame.upVector*.15 + -root.CFrame.RightVector*5.5 * CFrame.Angles(math.rad(22.52),math.rad(-135.9),math.rad(-69.64))
local f3 = root.Position + root.CFrame.LookVector*5.25 + root.CFrame.upVector*.5 + -root.CFrame.RightVector*2.75 * CFrame.Angles(math.rad(22.52),math.rad(-135.9),math.rad(-69.64))
local f4 = root.Position + root.CFrame.LookVector*7.5 + root.CFrame.upVector*1.3 + root.CFrame.RightVector*1.5 * CFrame.Angles(math.rad(22.52),math.rad(-135.9),math.rad(-69.64))

spawn(function()
    for t = 0,1,.08 do
        local curve = cubicBezier(t,f1,f2,f3,f4)
        rarm.CFrame = CFrame.new(curve)
        game:GetService("RunService").Heartbeat:Wait()
    end;
end)
``` someone said to use CFrame rotation property but idrk how to use please help

I switched it to use CFrame.Angles which i think is the rotation property but it still isnt working please help

Answer this question