Yeah, I'm in a pickle. Doing fps framework is hard and I only began to do testing with a test script and got this error now I'm confused at this point.
-- Variables local PLR = game.Players.LocalPlayer local runS = game:GetService("RunService") local Camera = workspace.CurrentCamera -- Gun setup local gun = game.ReplicatedFirst.Guns.UMP45:Clone() local Settings = require(game.ReplicatedStorage.GunModules[gun.Name]) local WeaponPos = Vector3.new(0,-0.5,0) -- Loads run service runS.RenderStepped:Connect(function() gun:SetPrimaryPartCFrame(CFrame.new() * WeaponPos) end) gun.Parent = Camera local idle = gun.Humanoid:LoadAnimation(game.ReplicatedStorage.GunModules[gun.Name].Animations.Idle) idle:Play()
Any help is needed
The problem here is that when you multiply a CFrame by a Vector3 you get a Vector3 (not sure though) So instead of gun:SetPrimaryPartCFrame(CFrame.new()*WeaponPos)
do
gun:SetPrimaryPartCFrame(CFrame.new(CFrame.new()*WeaponPos))
that is confusing, since you're multiplying an empty cframe by a vector you can just cast it directly.
So do this
-- Variables local PLR = game.Players.LocalPlayer local runS = game:GetService("RunService") local Camera = workspace.CurrentCamera -- Gun setup local gun = game.ReplicatedFirst.Guns.UMP45:Clone() local Settings = require(game.ReplicatedStorage.GunModules[gun.Name]) local WeaponPos = Vector3.new(0,-0.5,0) -- Loads run service runS.RenderStepped:Connect(function() gun:SetPrimaryPartCFrame(CFrame.new(WeaponPos)) end) gun.Parent = Camera local idle = gun.Humanoid:LoadAnimation(game.ReplicatedStorage.GunModules[gun.Name].Animations.Idle) idle:Play()
If this helped, mark this as the answer!