Hi. I am making a first-person view model, which looks like this:
I want to make it punch, but I’ve no clue on how to.
Here’s my code:
local Plr = game:GetService("Players").LocalPlayer
local Camera = game:GetService("Workspace").CurrentCamera;
local Mouse = Plr:GetMouse()
local offset = CFrame.new(0, -1.4, -.7);
local RS = game:GetService("RunService")
local UIS = game:GetService("UserInputService");
local viewModel = game:GetService("ReplicatedStorage"):WaitForChild("Viewmodel"):Clone()
viewModel.Parent = game.Workspace
UIS.MouseIconEnabled = false
local TweenService = game:GetService("TweenService")
local punching = false
Mouse.Button1Down:Connect(function()
end)
local function updateViewmodel(delta)
viewModel.Primary.CFrame = Camera.CFrame * offset
end
RS.RenderStepped:Connect(updateViewmodel)
Also, this is what my ViewModel contains:
Thanks for any help!