How can I make a camera attach to torso?

I Saw someone making a camera attach to workspace while running animations, i tried doing a crawl animation and the camera stood in place, how can I change the camera so it will be attached to the torso

2 Likes

I hope It’ll help you,

local player = game.Players.LocalPlayer
local camera = workspace.CurrentCamera
camera.CameraType = Enum.CameraType.Custom --// The Camera.CameraType property is read by the game’s camera scripts and determines how the Camera should update each frame.
camera.CameraSubject = player.Character.Humanoid --// The Camera.CameraSubject property is read by the game’s camera scripts and determines what object the Camera should follow.
camera.CFrame = player.Character.Head.CFrame --// The Camera.CFrame property represents the position and orientation of the camera.
4 Likes

The camera still attaches to the head

2 Likes

And I changed the fourth line to torso and it is still connected to the head

2 Likes

Where should the script be located?

2 Likes

To clarify the previous answer.

You can only change a player’s camera using a LocalScript, so make sure you’re using one.

If you want to change what the camera is looking at, which is the player’s head by standard, you must change its CameraSubject property.

local player = game.Players.LocalPlayer
local character = player.Character or player.CharacterAdded:Wait()
local camera = workspace.CurrentCamera

camera.CameraSubject = character.Torso
2 Likes

It does work but im trying to make the camera work like this:
https://i.gyazo.com/c1dfc096933167a7e8680be8ed5009ff.mp4
(game: SA2 [MAIN])

2 Likes

I’m not quite sure to make it look like that since I have barely scratched camera manipulation, I hope someone else can also assist you in your doubts.

2 Likes

Generally the camera moves with the character and that’s what I want to achieve

2 Likes

Well, I know this answer is very late [ Because the post is from October 2020. ], but I actually found a way to do that, modifying the PlayerModule > CameraModule > BaseCamera. Well, first of all, you need to get your PlayerModule from your StarterPlayerScripts. Run your game, open StarterCharacter, open StarterPlayerScripts and copy ‘PlayerModule’. Stop the game, paste the PlayerModule in StarterPlayerScripts, and after that you open PlayerModule > CameraModule > BaseCamera. You go to line 400, and modify this:

image

To this:

Here how the result looks like:

To be honest, I accidentaly discovered that pressing Ctrl + Shift + F, searching ‘owo’ and the first result was in BaseCamera. I pressed on it and accidentaly noticed that you could change that.

9 Likes

furry aaaaaaaaaaaaaaaaaaaaaaaaaaa

12 Likes

What’s the problem with being a furry?

2 Likes

Sorry for the late reply but that game looks awesome Is it open for testing?

Its a VERY, but VERY old version of that game, it was really glitchy and the codes were very messy. Sorry but no, its not open.

this worked for me but when in shiftlock the character doesn’t turn, it moves in the correct direction but does not rotate. do you know the solution to that?