How do I change the Camera's ViewPoint?

What is the issue?


As you can see in this video, by default Roblox’s Camera ViewPoint is in the center of the Custom Character.

What do you want to achieve?

image

I am making a First-Person Game and I want the Black colored part to be the Player’s Camera ViewPoint. (Sort of like the Player’s Eyes)

How do I go about achieving this? :thinking:

Have you had a look at this>

It seems to me you could just adjust the cameras position to be further forward in the player look direction.

Another way to do that is changing the character’s humanoid’s CameraOffset property to be in front of the character.

--StarterPlayer -> StarterCharacterScripts
local offset = Vector3.new(0,0,-2)

local character = script.Parent
local humanoid = character.Humanoid

humanoid.CameraOffset = offset

Edit: I messed the offset up, it’s supposed to be Vector(0,2,0). :sweat_smile:

3 Likes

Where is the character placed and the eyes?

Your script works fine except for one minor error. You set the Z-coordinate to -2, which resulted in the camera going to this position-

Normal Roblox Camera on Custom Characters:

image

Your Script Camera Changes:

The camera moves sideways instead of upwards.

I changed the Y-coordinates in place of the Z-coordinates and the script works perfectly!

local offset = Vector3.new(0,2,0)

local character = script.Parent
local humanoid = character.Humanoid

humanoid.CameraOffset = offset

I just wanted to point out this error, so that others who have the same problem and visit this topic and copy your script only for the camera to go haywire. :upside_down_face:

2 Likes