![]() ![]() Set camera cframe manually and then give control back to camera scriptĬamera.CameraType = Ĭamera.CFrame = CFrame.lookAt(cameraPos, playerCf.Position) Local cameraPos = (playerCf + lastDiffY - (lastDiff.Magnitude * Vector3.new(1, 0, 1) * playerCf.LookVector)).Position Return -prevent setting it if they are already in first person Local lastDiffY = lastDiff.Y * Vector3.new(0, -1, 0) Local playerCf = character:WaitForChild("Head").CFrame Values used for the camera cframe calculations Local character = player.Character or player.CharacterAdded:Wait() Local player = game:GetService("Players").LocalPlayer local function setCameraFacingPlayerDirection() If a server script needs to be able to do it, you should use a RemoteEvent to trigger the function on the client. It must be in a LocalScript ran on the client. ![]() This function in the code below that I made will reset the camera direction to wherever the local player’s character is facing. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |