Hi, Im attempting to code a first person system and unfortunately ive run into a problem.
For some reason, the code only seems to set the player’s CameraOffset to the correct position in one spot even though from visualizing the point in which theoretically the CameraOffset should be set (atleast I think), to the correct position always
Heres the code that I have
game["Run Service"].RenderStepped:Connect(function()
if not setting and set then
local lookvector = char.Head.CFrame.LookVector.Unit * script.OffsetAmt.Value
local headOffset = (char.Head.Position - (char.HumanoidRootPart.Position + Vector3.new(0,1.5,0))) + lookvector
local part = Instance.new("Part",workspace)
part.Size = Vector3.one/4
part.Material = Enum.Material.Neon
part.Position = (char.HumanoidRootPart.Position + Vector3.new(0,1.5,0)) + headOffset
part.Anchored = true
part.CanCollide = false
game.Debris:AddItem(part,3)
hum.CameraOffset = headOffset
end
end)
the solution is probably something easy that im just not realizing but ive tried looking it up and asking my friends and cant seem to find an answer, so any help would be appreciated, Thanks.