Camera Manipulation Question

I am trying to achieve a way to use TweenService or another smooth way to move the player’s Camera to make recoil for a FPS Game.

Problem: I’m not familiar with using TweenService, and I could not find a way to only manipulate only X, Y, or Z of the Camera CFrame. The only way that worked was to set the property table in the Tween to {CFrame = Camera.CFrame * and so on…}, though when the player is moving this tween hard sets the CFrame making your camera not move with your character because the recoil Tween is currently running.

To explain clearly what I’m trying to achieve, I’m looking for a way to tween only (in this case) the X coordinate of the Camera’s CFrame.

1 Like

have you tied to tween by putting the camera’s CFrame’s Y and Z position into the location you want the camera to go to?

Kinda like this:
CFrame.new(Vector3.new( X ,Camera.CFrame.Position.Y,Camera.CFrame.Position.Z))

^Dont know if the above code is right, haven’t tested

Well, the player can move however they want, meaning I can’t know where the player will be, the problem basically is, the tween keeps the same X,Y,Z values all the way through the tween and doesn’t change those values to match the current values based on how the player moves or doesn’t move around. That is why I was looking for a way to only affect one of the coordinate values on the Camera’s CFrame.

Yeah there’s no way to manipulate a single coordinate on roblox, you have to change all 3.