Help keeping the default camera behavior when the camera subject is changed?

Im making a custom character project and Im having trouble keeping the default behavior of the camera before its camerasubject is changed to the head.

I need the following:
I want the camera to cause the whole character to disappear when you zoom in completely.
I want the characters rotation to follow the camera when completely zoomed in.

all of these behaviors disappear when I change the camera to the head, here is the script I am using:

function setcam()
	local plr = game.Players.LocalPlayer
	local cam = workspace.CurrentCamera
	cam.CameraType = "Custom"
	cam.CameraSubject = script.Parent.Head
	
end



while true do
	wait(1)
	setcam()
end

am I using the wrong cameratype? or is there another way to keep everything the same?

1 Like

Is this for an NPC or something? I haven’t dabbled with the camera stuff in a while, but I think at some point I was able to get the standard behaviour working if I set the camera subject to a Humanoid.

Assuming it is an NPC, maybe try setting it to the Humanoid and see if that works?

You could script your own by calculating the distance between the head and the camera’s position
if it’s less than 1 than just loop through your character and make all the part’s transparencies to 1

I have the custom character inside the players character. the reason I need the camera to the head is because I need the camera a certain height based on the size of the custom character.

for example, lets say my custom character is a giraffe, everything inside the players character EXCEPT the head is all together at the bottom. I do this because of the humanoids hip height… the head is up top in the giraffes head, by setting the camera to the head I can have the camera were it needs to be and also keep everything else in the character at the bottom. all I need now is some way to keep the behaviors mentioned above. setting the camera to the humanoid as you said doesnt change its position any differently than the humanoidrootpart despite keeping the needed behaviors.

1 Like

Weird way to do custom characters in my opinion.
I highly suggest you change your system, Either way I do believe there is a property in the humanoid that deals with the camera.

Found it.
https://gyazo.com/da971b70a966dbb12519bd6cc6de37e7

Was looking through and looks like this is it:

Set the CameraOffset to be up by a few studs and I think you should achieve the same effect?

4 Likes

that seems to be working, thanks.