Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Camera rotate to head x,y,z?

I do not know if I worded the title right anyway...

What I'm Trying To Do I'm trying to make the current camera go to the postition of the players head. I have achieved this but It does not rotate to the y z or x of the head. Also for some reason it only follows the player if its on track. Code:

local player = game.Players.LocalPlayer
local character = player.Character
local camera = workspace.currentcamera
if not character or not character.Parent then
	character = player.CharacterAdded:wait()
end
camera.CameraType = 'Track'; 
camera.CameraSubject = character.Head;`

So if you could help me that would be very appreicated!

Thanks ~KiHeros

7 comments

0

Ah, try setting the camera to be 'Fixed' instead of 'Track'

0

Sadly that does not work :/

0

Drat... You might also try setting the Focus property of the Camera first, before you set the subject, I myself am trying to achieve the same goal as you are... and not getting much luck... :|

0

oh man.

0

lol... I want it for a nice death effect script... so far I can't get it to go to the Head and look where the head is pointing, but are you aiming for a First Person camera?

0

yeah xD I have it fully set up except for it not following the head y and x when i turn it up and down

0

Check my answer!

2 answers

✓ Accepted answer

Helped on stypi <3

If you're aiming for a FP camera, then do this:

local player = game.Players.LocalPlayer
local character = player.Character
local camera = workspace.currentcamera
if not character or not character.Parent then
    character = player.CharacterAdded:wait()
end
player.CameraMode= 'LockFirstPerson';	--This automatically sets the cam to First Person(Yay...)

Hope that helps!

4 comments

0

UHM... There is a problem I just noticed, roblox removed the "LockFirstPerson" mode... sorry...

0

Actually they have not but that is not the problem

0

I edited it, should work now...

0

I do not actually want it to be in first person that is why I'm making my own first person camera I just need the camera to follow the y of the head as in the actual first person mode the camera moves to fast and the head does not keep up with it so I'm trying to get the camera to follow the y position of the head.

This discussion is preserved as it was. New answers, comments, and votes are closed.