Problem with the zoom of my sight

  1. Well basically this is my first post as an official DevForum member lol but anyway, that’s not the focus right now. I was (am) making an fps system with a gun, just to really test and learn, and I’m not getting my camera in front of my sights, basically.

This part of the script below is basically the function that should make things happen lol, I tried using lerp() and tweenservice, I kept hunting on DevForum if any other dev had similar problems, and I kept hunting functions on DevHub to see if I could find anything that could help me, the streamable link below is a test I tried to do, in which I had tried using tweenservice to make the camera.CFrame go to a part that I had positioned in front of the holographic sight, but it didn’t work.

mouse.Button2Down:Connect(function()
  local aimcfr = CFrame.new()
 if Aiming == false then
     Aiming = true      
        print(Aiming)   
            aimcfr = aimcfr:Lerp(Aim.CFrame,1)
        elseif  Aiming then
      aimcfr = aimcfr:Lerp(CFrame.new(),1)
            Aiming = false
            print(Aiming)
       end  
end)   

Test

But anyway, if anyone can help me, I thank you from my heart <3 and hope we have a good time here on DevForum, I want to help you and meet other developers and most importantly: (in my opinion) make a difference! This is my dream since I was a kid :slight_smile:

with all the love in the world

Signed: Caio (I know it’s not a letter, leave me alone >:3)

When you make a new CFrame without any arguments, the position is (0, 0, 0), which probably isn’t what you want. Instead, you’ll want to offset your viewmodel, and I’d help you with that, but I don’t know how you position your viewmodel.

I want him to return to starting position (0,0,0) if he is not aiming, and I wanted to make the camera go to the holographic sight (as is being shown below)

Sorry for the late reply.

Instead of moving the camera to the sight, move the sight to the camera. If you want to make the zoom effect, lower the camera’s FOV.