How would i achieve this?

How would I achieve locking the Player Camera like this?

I have tried using CFrame and other methods and they dont work

Code Samples Appreciated

image
image

2 Likes

You could do player.CurrentCamera I believe.

I have done so to no avail that only gets the camera

How would the camera be locked? Click a block or click a TextButton?

Text Button is what i want and what i need

Try

script.Parent.MouseButton1Click:Connect(function(player)
  game.Workspace.CurrentCamera.CameraType = "Scriptable"
		game.Workspace.CurrentCamera.CFrame = CFrame.new(player.Character.HumanoidRootPart, Vector3.new(xyz)
end

I am not really that good with this but idk it’s worth a shot.

1 Like

i want it to be minused of atleast 25 studs of the Players Upper-Torso

I edited the script and added vector 3.

@Not_Infimax does it work?

I think to lock the camera you can set the camera to scriptable ! :wink:
I hope that was helpful and have a nice day ! :smile:

Will try now thank you very much for your help

Did it work now?

[spoiler]This text will be blurred[/]

@Not_Infimax I proposed the solution so can you set the other post I made as solution?

you could maybe try player.currentcamera to set it to whatever you want to

What do you mean by

Do you want to set the camera view to a certain part to prevent the player from moving it himself?

(in a local script)

local button = -- index to your button
local active = false

button.MouseButton1Click:Connect(function()
     if not active then -- check if camera isn't already positioned
          active = true
          local pcam = workspace.CurrentCamera
          pcam.CameraType = Enum.CameraType.Scriptable
          pcam.CFrame = game.Players.LocalPlayer.Character.HumanoidRootPart.CFrame + Vector3.new(x,y,z) -- put in different values for xyz and see what works best
     else -- reset camera to default
          local pcam = workspace.CurrentCamera
          pcam.CameraType = Enum.CameraType.Custom
          active = false
     end
end)