Hello, And Happy New Years Eve.
Off-Topic Rant
We Made it to 2023, Proud of Yourself?
I hope so, We went through a Virus, Economy, and a “Special Military Operation”, We can only hope that this new year will be better, and safer for all of us.
So When testing my FPS stuff, I noticed that the Animations would Randomly stop playing after a certain point, It continues to do this until i equip another Tool, or it Decides to go back to normal.
It works well however, Everything seems to be working, besides this ONE issue, both on Studio and Game it looks good, But this issue happens both on Studio, and on the Roblox Game Itself.
This was tested on the Game itself btw, and not on Studio
Normally, There would be a Firing animation and a Aiming Animation, But that for some reason isnt happening.
It Isn’t the Tool that’s doing it, but the Viewmodel itself, as it appears to just randomly freeze at random points while on the Character, its perfectly fine. What could be going on?
I have Checked the viewmodel and the Script, But there doesn’t appear to be any issues to cause this.
Viewmodel Controller Script
RunService = game:GetService("RunService")
Plr = game.Players.LocalPlayer -- Player
Chr = script.Parent -- Character
Camera = workspace.CurrentCamera -- Camera
Mouse = game.Players.LocalPlayer:GetMouse() -- Mouse
VM = game.ReplicatedStorage.Viewmodel:Clone() -- Viewmodel
VM.Parent = Camera -- Parents to Camera
SwayAMT = -.4 -- Sway Speed
LastCF = CFrame.new()
SwayCF = CFrame.new()
Bobbing = CFrame.new()
-- CFrame's
local TO: BasePart = Chr["Torso"]
local RA: BasePart = Chr["Right Arm"]
local LA: BasePart = Chr["Left Arm"]
-- Limb's
local Left: Motor6D = TO["Left Shoulder"]
local Right: Motor6D = TO["Right Shoulder"]
-- Motor6D's
NormalArm = Vector3.new(1,2,1) -- Normal Arm Size
Negate = .7 -- Number for Arm Size
ArmNegation = Vector3.new(Negate,2,Negate) -- New Arm Size
-- Arm Stuff
Main = { -- Probably useless
[1] = script.Parent;
[2] = script.Parent:FindFirstChildOfClass("Humanoid");
}
Limbs = { -- also Probably useless
[1] = Chr["Head"];
[2] = Chr["Torso"];
[3] = Chr["Left Arm"];
[4] = Chr["Right Arm"];
[5] = Chr["Left Leg"];
[6] = Chr["Right Leg"]
}
Atts = {} -- Actually Useless
RunService.RenderStepped:Connect(function()
--[[ Sway and Bobble Stuff
local Rot = Camera.CFrame:ToObjectSpace(LastCF)
local X,Y,Z = Rot:ToOrientation()
local Rota = CFrame.Angles(math.sin(X) * SwayAMT,math.sin(Y) * SwayAMT,math.sin(Z) * SwayAMT)
SwayCF = SwayCF:Lerp(Rota, .1)
LastCF = Camera.CFrame
Bobbing = CFrame.new(Main[2].CameraOffset.X/3, Main[2].CameraOffset.Y/3, Main[2].CameraOffset.Z/3)
]]
RA.LocalTransparencyModifier = 0
LA.LocalTransparencyModifier = 0
VM:SetPrimaryPartCFrame(Camera.CFrame * CFrame.new(0,-1.5,0) * SwayCF * Bobbing) -- Follows Camera
local dist = (Camera.CFrame.Position - Limbs[1].Position).Magnitude -- Camera Zoom Distance
if dist < 1 then -- Moves Arms Part0 to Viewmodel if Zoomed in
LA.CastShadow = false
RA.CastShadow = false
Right.Part0 = VM.Torso
Left.Part0 = VM.Torso
RA.Size = ArmNegation -- New Arm Size
LA.Size = ArmNegation
else -- Restores Arms to Character if Zoomed out
LA.CastShadow = true
RA.CastShadow = true
Right.Part0 = Chr.Torso
Left.Part0 = Chr.Torso
RA.Size = NormalArm -- Normal Arm Size
LA.Size = NormalArm
end
for _,i in pairs(VM:GetChildren()) do
Mouse.TargetFilter = i -- Filters Viewmodel
end
-- Below here is the Camera Bobbing Effect, Not Important here tho
end)
What could be the issue?