Heyyy, working on a first-person system with unique avatars. JUST started working on it and I’m pretty new to lua since I’ve been a builder for the most part up until now, I wanted to see if anyone had any suggestions. So far, I’ve locked the camera to the head, which is very much the intent but I’m not sure how I go about controlling the head’s rotation through mouse INPUT. I’ve seen stuff discussing part rotation following the mouse’s position but upon further search, I can’t find any discussing controlling the object based on INPUT.
Effectively, I’ve got what I wanted so far but the camera cannot move since the head cannot rotate. Anyone tried this before? I’m looking to try out an idea, from humanoid avatars to avoiding viewports and keeping it raw.
I’m iterating through it at the moment so I may find the solution but I wanted to see how anyone else would do it! There are usually more ways than one to do everything. If you want any other details, please reach out or respond, otherwise I appreciate anyone supplying a suggestion/approach. I’ll drop what I have so far down below. (I’m using R6 since this avatar was made from scratch, and it has every joint and part R6/R15 has, so I can assure you there is a head which you’ll see I use below).
local runService = game:GetService("RunService")
local camera = workspace.CurrentCamera
local character = script.Parent
local head = character:WaitForChild("Head")
camera.CameraType = Enum.CameraType.Scriptable
head.LocalTransparencyModifier = 1
runService.RenderStepped:Connect(function(deltaTime)
camera.CFrame = head.CFrame
end)