I want to make a camera that when you go into first person, it goes slightly ahead of your character, as in likewhen i look down, if the torso was visible, instead of seeing the middle i would see the front
problem is, I have no idea how to manipulate the camera.
roblox’s article’s are unhelpful in this case.
if anyone requires a screenshot of what I mean just ask it
Could you send a screenshot so I can better understand what your trying to do, Im more of a visual person myself so I can help you if you upload some sort of reference
no i don’t need first person body, i need the camera more forward.
as in from this:
Is this game only going to be strictly first person or both?
it’s first person only, so the code should be less complex
Alright well lets break it down,
Forward in 3D space is Negative Z
So that would have to mean we would have to change the Z of the Camera by how ever many studs forward
see I don’t know how to script, so how would I set the camera forward? the roblox article was unhelpful o_o
yea they really need to update that thing but i digress
So basically the camera has a CFrame and thats what we are going to want to manipulate
Your going to have to make the camera scriptable so we can actually use it, and then after that we can start messing with it!
camera.CFrame = camera.CFrame + camera.CFrame.LookVector * AMOUNT
Its really as simple as that
Well obviously youd want to set the camera back to custom but yeah, just put this in a playeradded event on the client/local script
The property you’re looking for is Humanoid.CameraOffset.
Here is an example. This is a LocalScript that goes in StarterCharacterScripts.
local character = script.Parent
local humanoid = character:WaitForChild("Humanoid", 10)
if not humanoid then return end
humanoid.CameraOffset = Vector3.new(0,0,-1) --The offset relative to the head.
You can use Humanoid.CameraOffset this can be used in LocalScript .
local player = game:GetService("Players").LocalPlayer --I preffer using GetService()
local character = player.Character or player.CharacterAdded:Wait() --Lets wait till the character loads
local humanoid = character:WaitForChild("Humanoid") --Check if character has humanoid
humanoid.CameraOffset = Vector3.new(1,0,0) --For camera offset is Vector3.new() used!
Oh thanks alot everyone, I’ve learned some new parameters