How can i custom camera position

Hello i want to MMORPG game . But idk how i can change the camera position. I watched tons of video but they are doing only firstperson. I want to do something similar to the camera position in the photo. And I want to allow them to zoom in and out of the camera, but I don’t want them to switch to first person. If you have any articles or tutorial videos that I need to know, I would appreciate it if you could share them.

Ty for help!

1 Like

you can set the Humanoid.CameraOffset property which is self explanatory, and then set the mincamerazoom which is there somewhere on starterplayer if i remember correctly

local RunService = game:GetService("RunService")

local Player = game.Players.LocalPlayer
local Char = Player.Character
local Camera = workspace.CurrentCamera

Camera.CameraType = Enum.CameraType.Scriptable

local Offset = Vector3.new(.001, 10 , 15)

RunService.RenderStepped:Connect(function()
	local CharPos = Char.HumanoidRootPart.Position
	local CameraPos = CharPos + Offset
	Camera.CFrame = CFrame.new(CameraPos, CharPos)
end)

I tried this but camera is locked how can i fix this

if you dont want it to lock, you have to remove your runservice loop and don’t change the cameratype to scriptable

i would do something like this, roblox has a offset feature for the humanoid:

(made this on mobile, should be in starterplayer)

local player = game:GetService(“Players”).LocalPlayer
local offset = vector3.new()

player.CharacterAdded:Connect(function(character)
local humanoid = character:FindFirstChildOfClass(“Humanoid”)
humanoid.CameraOffset = offset
end)

This is not how Camera works. You would need to code a camera system of your own. The best method is what Herstal_PinkP90 has suggested that is to use the Humanoid.CameraOffset property like so:

local Game = game
local Players = Game:GetService("Players")

local Player = Players.LocalPlayer
local Character = Player.Character or Player.CharacterAdded:Wait()
local Humanoid = Character:FindFirstChildOfClass("Humanoid")

local Offset = Vector3.new(0, 10 , 15)
Humanoid.CameraOffset = Offset

As for why the issue occurs, it’s because you are first of all setting your CameraType property to Scriptable which stops all Roblox Core Scripts from manipulating the camera. Next, you are setting the CFrame of the camera to the player’s HumanoidRootPart’s position with some offset which just makes it have no orientation and just be translated wherever the character walks to.

Whereas, using CameraOffset doesn’t stop Roblox Core Scripts from manipulating the camera and also properly adds an offset to the Camera.

Hey, thats why i said already, this is unneccesary

Apologies, I did not read your response. To set us apart, I’ll just add a reason to why the issue occurs.

1 Like

Its not has a any camera zoomout and zoomin limit which variables help it?

local Players = game:GetService(“Players”)

local player = Players.LocalPlayer

player.CameraMaxZoomDistance = 50
player.CameraMinZoomDistance = 75

ty for this documentation i want this

1 Like

No problem, have a nice evening / day!

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.