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

Best way to make Global Animations w/ Motor6D?

Asked by
Ince_FS 13
5 years ago
Edited 5 years ago

I'm scripting a game, and I'm using Motor6D to animate things. What is the best way to do this?

local Services =
{
    PLS = game:GetService("Players");
    RS = game:GetService("RunService")
};
local Player = Services.PLS.LocalPlayer;
local Mouse = Player:GetMouse();
local Char = Player.Character;
local RightUpperArm = Char:WaitForChild("RightUpperArm");
local RightShoulder = RightUpperArm:WaitForChild("RightShoulder");
local HumanoidRootPart =Char:WaitForChild("HumanoidRootPart");

Services.RS.Stepped:Connect(function()
    local Direction = Mouse.Hit.p+(Mouse.Hit.lookVector*5000);

    local RCF = HumanoidRootPart.CFrame;
    local ROFF = (RCF-RCF.p):Inverse();

        RightShoulder.Transform = ROFF*CFrame.new(Vector3.new(0, 0, 0), Direction)*CFrame.Angles(math.pi/2, 0, 0);
end);
0
im so curuios......what does line 17 and 18 do? Tizzel40 243 — 5y
0
It returns the inverse of CFrame. Ince_FS 13 — 5y

Answer this question