How can I make ADS system for viewmodel

  1. What do you want to achieve? Keep it simple and clear!
    I want to achieve aim down sights system for my viewmodel

  2. What is the issue? Include screenshots / videos if possible!
    the issue is that my viewmodel teleports into it’s ADS position, but it should smoothly move to it’s needed position

  3. What solutions have you tried so far? Did you look for solutions on the Developer Hub?
    I tried looking for my problems solution on many other websites including developer hub, but I couldn’t find any solutions for my current problem, so I hope that you can help me with it

Here’s my current code

rs.RenderStepped:Connect(function()
		local Rotation = workspace.CurrentCamera.CFrame:ToObjectSpace(LastCameraCFrame)
		local X,Y,Z = Rotation:ToOrientation()
		SwayCFrame = SwayCFrame:Lerp(CFrame.Angles(math.sin(X) * SwayEffect, math.sin(Y) * SwayEffect, 0), 0.1)
		LastCameraCFrame = workspace.CurrentCamera.CFrame

		if arms.PrimaryPart then

			if not aiming then
				arms:SetPrimaryPartCFrame(cam.CFrame * SwayCFrame)
				tweenService:Create(cam, TweenInfo.new(.05, Enum.EasingStyle.Linear, Enum.EasingDirection.InOut), {FieldOfView = 70}):Play()
			else
				aimpart.CFrame = aimpart.CFrame:Lerp(cam.CFrame * SwayCFrame, .5)
				tweenService:Create(cam, TweenInfo.new(.25, Enum.EasingStyle.Linear, Enum.EasingDirection.InOut), {FieldOfView = 50}):Play()
			end
		end
	end)


	arms.Parent = workspace.Camera
1 Like