Hello,
So i’ve been creating a gun and now I want it to aim and i have no idea on how to do it.
Heres a code:
local runningoffset = CFrame.new(Vector3.new(0,-2.2,0)) * CFrame.Angles(0,math.rad(80),math.rad(60))
local bobbleX = math.cos(tick() * 6) * .25
local bobbleY = math.abs(math.sin(tick() * 6)) * .25
local bobble = Vector3.new(bobbleX, bobbleY, 0) * math.clamp(char.PrimaryPart.Velocity.Magnitude,0.1,0.5)
local x = weapon.Assets.Aim.CFrame:Lerp(viewmodel.PrimaryPart.CFrame,script.AimAlpha.Value)
viewmodel:SetPrimaryPartCFrame((game.Workspace.Camera.CFrame + bobble) * script.PositioningOffset.Value)
and this are the components of a gun
I’ve been trying this tutorial already but it actually didnt work
I’ve been trying for 30 minutes now and it still didnt work.
Please help!