Forgive me if I’m not being clear enough, this is the first time in a while I’ve ever needed to ask a question on the devforum.
I’m designing a camera script for my game where it is a simple modified version of the “Follow” camera script. I forked the PlayerModule script, placed it in StarterPlayerScripts, and directly changed the line that is normally used to update the camera (after all math is calculated) as a tween.
This is the way I did it. On line 504 of CameraModule, I noticed it updates the camera of the player directly:
game.Workspace.CurrentCamera.CFrame = newCameraCFrame
To achieve my smooth effect, I changed the line to this:
Tween.tweenset( game.Workspace.CurrentCamera, newCameraCFrame ,step,"Sine","InOut","CFrame" )
Tween.tweenset is an outside self-made ModuleScript that essentially simplifies the whole tweenservice processing to one line. The format is given as
Object, NewValue, Time, EasingStyle, EasingType, Property. For most functions this is essentially simple, but I notice this effect is problematic when in first person.
I think there is something in the TransparencyController module that is causing this effect, so I took a look. The script is kind of complicated for me to understand, so I tried to look up some solutions on the devforum-- hardly any gives me an understanding. I also tried to trace my steps back on the
newCameraCFrame script, but it goes through so many other values that I get a migraine. I believe TransparencyController checks to see how far the camera currently is from the player, which is what the smooth tweening affects. I still want the same tweening effect in first person (although I can remove it somehow if I have to). I’m thinking of getting the value of the player’s current zoom to affect the transparency. What value do I grasp to port to the TransparencyController module, so that it doesn’t depend on the distance of the player but instead how close the player zooms in?
If there is a better solution to fix the transparency issue, I’m open to ideas.