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

How to ignore HumanoidRootPart?

Asked by 2 years ago

Hi! I'm trying to make a FPS system and my character will simply flings out of existence. My arms look like this If i change the HumanoidRootPart then the issue is fixed but my animations become broken. Any help?

localscript that adds the arms:

local plr = game:GetService("Players").LocalPlayer
local char = plr.Character or plr.CharacterAdded:Wait()
local cam = game.Workspace:WaitForChild("Camera")
local arms = game.ReplicatedStorage:WaitForChild("Arms")
local rs = game:GetService("RunService")
local uis = game:GetService("UserInputService")

local plrarms = arms:Clone()
plrarms.Parent = workspace
plrarms.Name = char.Name .. "_Arms"
plrarms:SetPrimaryPartCFrame(cam.CFrame)

rs.RenderStepped:Connect(function()
    plrarms:SetPrimaryPartCFrame(cam.CFrame)
end)
task.wait()
if char:FindFirstChild("Shirt") then
    plrarms.Shirt.ShirtTemplate = char.Shirt.ShirtTemplate
else
    plrarms.Shirt.ShirtTemplate = "rbxassetid://4699552332"
end

localscript that animates it:

local plr = game:GetService("Players").LocalPlayer
local char = plr.Character or plr.CharacterAdded:Wait()
local cam = game.Workspace:WaitForChild("Camera")
local arms = workspace:WaitForChild(char.Name .. "_Arms")
local animi = script.Idle
local animr = script.Reload
local animf = script.Fire
local track

track = arms.Humanoid:LoadAnimation(animi)
track.Priority = Enum.AnimationPriority.Action
track.Looped = true
track:Play()

can someone help?

0
The Humanoid is in the Char not the arms MattVSNNL 620 — 2y

2 answers

Log in to vote
0
Answered by
MattVSNNL 620 Moderation Voter
2 years ago

Don't play animation on a local script, Play it on a server script

0
Wouldn't that replicate on the server as well, right? xXLegendGamerz16Xx 231 — 2y
0
If you play it on the local player then everyone sees that animation play only on the one player MattVSNNL 620 — 2y
Ad
Log in to vote
0
Answered by 2 years ago

I already fixed this by adding an AnimationController and an Animator inside and renaming HumanoidRootPart. Thanks to everyone who tried to help though!

Answer this question