Problem with the Humanoid CameraOffset Property

Hello people!

I am trying to change the offset of the Humanoid’s Camera.
From a script, I tried the following code.

hit.Parent.Humanoid.CameraOffset = Vector3.new(0, -0.5, -0.4)

I then tried running the code, nothing happened.

I then added a print line to check if my script was running

hit.Parent.Humanoid.CameraOffset = Vector3.new(0, -0.5, -0.4)
print("Done!")

The game did print, but no changes were made, even after checking the explorer window.

Edit: The “hit” contains a part that is the result from a :Touched(), and yes, I checked if the humanoid si recognized. Also, the script does some other edits to the humanoid, and the humanoid received the other changes.

How does this work?

Thanks in advance,
Mehdi

1 Like

It’s not documented but CameraOffset is not replicated and it must be changed through a LocalScript for it to function properly. You’ll notice in a test session that if you change CameraOffset from the server view and then change back to the client view, nothing changes. You’ll also notice that the client doesn’t see what the server set CameraOffset to.

7 Likes

Thanks! Also, thanks for taking some time and trying to help me by actually going to Studio as I see that the link you included to my post is a recent post.

I’m trying to make a newindex function in a metatable that allows me to set the Camera Offset of the Humanoid on the server, am I not doing this correctly? I NEED it for server use.

It has to be on client. Also, please avoid reviving topics that have a clear solution.