I’m sure this is a fairly simple one but for whatever reason I can’t find the answer. I would appreciate it if someone could help me find some code that does these things:
Camera faces the player from the front no matter what direction the player faces. (Not a loop)
Camera is situated a few studs away from the character so you can view the whole character.
Camera is a few studs to the left of the character so the character is on the left side of the screen.
It is pretty simple, you can check the CFrame guide at Roblox documentation to figure out how to make a camera script that does these tasks for you, here’s the link: CFrames | Roblox Creator Documentation
If you’re asking for code done by other person, sadly I can’t help you, the best I can do is to provide pseudocode:
playerHead = player.Character.Head
camera = workspace.CurrentCamera
runService.Heartbeat:
camera.CFrame = -- do cframe stuff that you learned in the docs
This doesn’t help me. The code you provided contains something I asked not to be in it, and I know how to CFrame. For some reason it just isn’t working for me. Ill provide the code I have so far.
This code may look poorly cuz I’m writing it in the post thing
local playerHead = character.Head
camera.CameraType = Enum.CameraType.Scriptable --// Allow us to set the CFrame of the Camera
local flipYAxis = CFrame.fromAxisAngle(Vector3.yAxis, math.pi * 2)
local targetCFrame = playerHead.CFrame * CFrame.new(-5, 0, -10) * flipYAxis
camera.CFrame = targetCFrame
If it turns out that the player is on the right of the screen then just change -5 to 5
Works really nicely thanks. And I wasn’t really clear enough, I intend it to be a button you click, it changes the camera and freezes your character, click the button again and it resets it, I just removed the loop, Thanks a lot