Hello, I’m trying to make a camera in which the camera is always facing where the head is facing at.
For example, if I do the flip I want the camera to do a flip as well.
I tried changing the camera subject to the head, but it has no control and the angle doesn’t actually change too. I also searched up a lot of posts, but didn’t get the desired result. Is there any way I can do this?
Have you tried setting the camera orientation to the HumanoidRootParts as it should account for orientation of the character, but setting the position at the characters head? EDIT: Sorry for so many edits, it’s kinda hard to get the right words lmao
True, it does work, but the only problem is that you can’t move your mouse 360 degrees.
My problem right now is that even if I set the camera’s CFrame to the head, you can’t move the head. So is there a way I can move the camera, while having the camera’s CFrame set as the head’s???
game:GetService("RunService").RenderStepped:Connect(function(delta)
if c and c:FindFirstChild("Head") then
local mouse_position = Vector2.new(m.X,m.Y)
local screen_size = cam.ViewportSize
local mouse_centre_offset = (mouse_position/screen_size)-Vector2.new(0.5,0.5)
local mouse_camera_rotation = CFrame.Angles(-mouse_centre_offset.Y, -mouse_centre_offset.X * math.pi * 2, 0)
cam.CFrame = c.Head.CFrame*CFrame.new(0,0.25,-0.375)*mouse_camera_rotation
end
end)
this is the furthest i’ve gotten, you can rotate your camera freely, but i cannot get the players character to rotate along with the camera
After some tweaking I got a result I’m really happy with. The only thing is there a way I can stop the camera? For example, if I move the mouse on the right it just infinitely turns. I think it’s impossible since you have to have the mouse not locked to the center so as of right now it works. Thanks!