I am trying to have this camera locked on all axes but still follows the player around, however this isn’t happening. I am getting an error but I don’t know how to solve it.
Here’s my script (with bad indenting, sorry)
local CC = workspace.CurrentCamera
local HRP = workspace:WaitForChild(game.Players.LocalPlayer.Name):WaitForChild('HumanoidRootPart')
CC.CameraType = Enum.CameraType.Attach
local function bindCamera()
CC.CFrame.Position = Vector3.new(CC.CFrame.Position.X, 20, CC.CFrame.Position.Z)
end
game:GetService('RunService'):BindToRenderStep('Camera', Enum.RenderPriority.Camera.Value + 1, bindCamera)
Here’s the error (yup, the sentence just cuts off like that lol)
RunService:fireRenderStepEarlyFunctions unexpected error while invoking callback: Position cannot be assigned to
EulerAngles can have problems from time to time, see if this will fix it. Bear in mind I have no experience with BindToRenderstep and priorities with this sort of thing.
Cam1, Cam2, Cam3 = CC.CFrame.XVector, CC.CFrame.YVector, CC.CFrame.ZVector
local function bindCamera()
CC.CFrame = CFrame.fromMatrix(CC.CFrame.Position, Cam1, Cam2, Cam3)
end
Same thing, no erroring but the hole isn’t being followed properly attach, or at all with scriptable. Pretty much all I want to achieve right now is to follow the character, but the camera should be locked, unable to move unless the character is moving.
There are obviously a few things to fix up, but that’s generally what I wanted. You also had to create a button to activate as it wouldn’t activate normally. Thank you guys for the help!