How do I make CFrame changes overwrite animations and tools?
I am decently new to CFrames and completely new at CFrame animation. I couldn't find any tutorials on how to do CFrame animations so I used the animation plugin to make an animation then just printed the .C1 of all the character joints for each frame and put them in a table. Then I just had a for loop set my characters joints to those when you click with a tool equipped. The animation works, but the problem is any animations that play while it is playing the CFrame animation play over it. So if the player jumps their arms flail and their feet pull pack. And because the player has a tool equipped their arm is extended and its CFrame doesn't change.
Here is the script (minus the cframes because question was over 10,000 characters and would not post)
01 | local player = game.Players.LocalPlayer |
13 | local tool = Instance.new( "Tool" , player:WaitForChild( "Backpack" )) |
14 | tool.Name = "DJ Booth" |
15 | tool.GripPos = Vector 3. new( 0 , 1 , 0 ) |
16 | local suitcase = Instance.new( "Part" ,tool) |
17 | suitcase.Name = "Handle" |
18 | suitcase.Size = Vector 3. new( 2 , 2 , 0.5 ) |
19 | suitcase.CanCollide = true |
20 | local mesh = Instance.new( "SpecialMesh" ,suitcase) |
23 | mesh.Scale = Vector 3. new( 5 , 5 , 5 ) |
25 | tool.Equipped:connect( function (Mouse) |
26 | Mouse.Button 1 Down:connect( function () |
27 | if clicked = = false then |
30 | if player.Character:FindFirstChild( "Humanoid" ) then |
31 | if player.Character.Humanoid.RigType = = Enum.HumanoidRigType.R 6 then |
32 | player.Character.HumanoidRootPart.Anchored = true |
33 | local torso = player.Character.HumanoidRootPart.RootJoint |
34 | local rightarm = player.Character.Torso [ "Right Shoulder" ] |
35 | local leftarm = player.Character.Torso [ "Left Shoulder" ] |
36 | local rightleg = player.Character.Torso [ "Right Hip" ] |
37 | local leftleg = player.Character.Torso [ "Left Hip" ] |
38 | local speed = player.Character.Humanoid.WalkSpeed |
39 | player.Character.Humanoid.WalkSpeed = 0 |
45 | leftarm.C 1 = lshoulder [ i ] |
46 | rightarm.C 1 = rshoulder [ i ] |
54 | leftarm.C 1 = lshoulder [ j ] |
55 | rightarm.C 1 = rshoulder [ j ] |
58 | player.Character.HumanoidRootPart.Anchored = false |
59 | player.Character.Humanoid.WalkSpeed = speed |
69 | player.CharacterAdded:connect( function () |
73 | if player.Character then |
74 | if player.Character:FindFirstChild( "DJ Booth" ) = = nil and player.Backpack:FindFirstChild( "DJ Booth" ) = = nil then |
So how would I temporarily disable the player's animations and make the player's hand not extend with the tool equipped? I know I could use a HopperBin but those are depreciated.