Hi all, I am currently using a heavily modified version of the endorsed weapons kit for my game, but I am running into an issue that is also present in the weapons kit files in this thread.
Essentially, when you unequip a weapon while zoomed in, the camera maintains the field of view values it had while zoomed. It is not very noticeable with weapons that have sights (FOV changes from 70->65, which is barely noticeable), but if you try it with a weapon with a bigger ZoomFactor like the Sniper Rifle, then it becomes apparent.
Like I mentioned, this issue is also present in the files previously attached to this thread. Any idea how to fix this?
Was actually able to figure this out. Essentially what is happening is the zoomFactor functions are being called correctly, but on unequip the main ShoulderCamera loop is not updating the camera to reflect the updated zoom numbers.
Within ShoulderCamera, there is a function “setEnabled”. If you go into the else statement in this function (which is called when setEnabled is false on unequip), you can add the SpringService line of code so the camera will update with the new zoom factor after unequipping. The code should look like this:
ShoulderCamera.SpringService:Target(self, 0.8, 3, { zoomAlpha = self.zoomState and 1 or 0 })
ShoulderCamera.SpringService:Target(self.currentCamera, 0.8, 3, { FieldOfView = self.desiredFieldOfView })
… add this line, so that we have the original C0 CFrame value stored.
if not self.tiltFix then self.tiltFix = self.rootJoint.C0 end
Now, when the weapon is unequipped, set rootJoint.C0 to the tiltFix CFrame value. For example, I have this line in a LocalScript, connected to the Unequipped event:
This is an old post, but I made a complete fix Free Model for the Weapons Kit for anyone trying to search for how to fix it. It also fixes some other issues that have not previously been mentioned in this thread.