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 :
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))
Just use the camera’s
how should I implement that into my script?
root.CFrame = CFrame.new(camera.CFrame.Position)
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.
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:
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
What is it
This module will help you set up a smooth and customizable over-the-shoulder camera system, which is quite popular in video games. You don’t need to know how to script to set this up, however, it also allows considerable customization for those who do know how to script. You can grab the ROBLOX model from here or read the source on GitHub from here. You can also test the basic system out at this place.
How to use it?
Getting started is very easy. Just insert the module script wher…
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
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!