Help making the HumanoidRootPart follow camera

I need help making the HumanoidRootPart follow camera.

I’ve tried a mouse following script from one of my older games and replaced it with camera and it sorta worked but I was facing backwards. This is what I tried :

game.Players.LocalPlayer.CharacterAppearanceLoaded:Wait()

game:GetService("RunService").RenderStepped:Connect(function()
	local root = script.Parent.HumanoidRootPart
	local cam = game.Workspace.CurrentCamera

	root.CFrame = CFrame.new(root.Position, Vector3.new(cam.CFrame.X, root.Position.Y, cam.CFrame.Z))
end)
2 Likes

Just use the camera’s LookVector

4 Likes

how should I implement that into my script?

1 Like
root.CFrame = CFrame.new(camera.CFrame.Position)
1 Like

that doesn’t work, that would just tp me to where the camera is infinitely

Well then you need to be more specific with your description. I can’t read your mind. You’ve added very minimal data, plus you said you want the HRP to follow the camera. So you must’ve stated your question wrong.

1 Like

is your script meant for R15 or R6? And do you want the entire body to rotate to the camera or just the upper body?

R6, and I’m talking about the entire body

I’m guessing you want the entire player to be visible. For this, you would need to offset the camera. I don’t exactly know what type of camera you are looking for, but Roblox has a top-down camera example here that might be helpful:
https://education.roblox.com/en-us/resources/arcade-game-top-down-camera

???
That’s not what I’m talking about.
I’m talking about the character rotating along with the camera.

Like an over-the-shoulder camera, but without the camera offset.

Anime Battle Arena’s camera is a good example of what I’m trying to do.

I found this over the shoulder camera system by Arbeiters:

This makes it easy to get the effect you want without having to code a bunch of stuff like offsets yourself. You can tweak the values and stuff too from the looks of it.

Yeah I know but I’m really trying to avoid using any modules for my game

1 Like

local rootPart = Character:FindFirstChild(“HumanoidRootPart”)
local rx, ry, rz = Camera.CFrame:ToOrientation()
rootPart.CFrame = CFrame.new(rootPart.CFrame.p) * CFrame.fromOrientation(0, ry, 0)

many many many thanks from me!

1 Like