Help with camera manipulation


How can I make it so that I can manipulate the camera so that the character is always on the right side of the screen and the camera is facing TOWARDS the player at all times, even if the character moves?

Here is my current attempt, it gets the position right but it doesn’t account for different screen sizes and it doesn’t always face the character:

connection = RunService.RenderStepped:Connect(function()
			camera.CFrame = CFrame.lookAt(Player.Character.HumanoidRootPart.Position + Vector3.new(0,2,10),Player.Character.HumanoidRootPart.Position) + Vector3.new(-9.5,0,0)
		end)

Hi there, let me see if I can help: there a few of ways to do this here

  1. Viewport Frames you can use it to have constant image of the character, and it would always account for screen size if you set the UI to scale, the downside is it would not look to great, and it is not very well optimized.

  2. Tweening the camera to a part this would probably be along the lines of what you are looking for: you could weld a part to the character, at the desired distance, and whenever the player moves, tween the camera to the location of the part for a neat delay effect.

  3. Separate room This one is probably not what you’re looking for, but works anyways: you could make a separate room with a copy of the player model in it, then position a part to your desired distance from the player that you set the camera CFrame to.

Let me know which one works best for you, and I will try my best to help you with the process.

Viewport frames and a seperate room are out of the question (due to some other issues with those). I would really prefer using CFrame manipulation but I could try the part.

The issue with the part is making it scale correctly on different resolutions as well.

I have done some research and found that using the absolute values of Frames in the ScreenGui provides the dimensions of a player’s screen, I would imagine that using some if statements or something along those lines, and using the results to adjust the position of the part, would help make it fit on the screen.

Here is a discussion on the DevForum about the matter if your interested: Discussion (Granted the discussion is not quite about what you are looking for, but it has the same concept and principles so that is why I thought it would work). If you have any other questions let me know.