when i do that it just stays in the center
im kinda confused now, could ya explain a little better what do ya want?
i want to be able to look around normally just with the camera position at a different place and not focused on the character as if I’m in first person
you could set the camera subject to the instance that you want to be viewing instead, and if ya want to go back to your character, you just set the camera subject to your humanoid
alas… there be no instance to set it to
I want to be looking around like this:
just not from my character but from a stationary camera like this(cube being the camera cframe):
Its just staying stationary not moving at all
local runservice = game:GetService("RunService")
local userinpuservice = game:GetService("UserInputService")
local camera = game.Workspace.CurrentCamera
local player = game.Players.LocalPlayer
local mouse = player:GetMouse()
local setup = game.Workspace["Player Setup"]
local camerapart = setup:WaitForChild("Camera")
camera.CameraType = Enum.CameraType.Fixed
runservice.RenderStepped:Connect(function()
camera.CFrame = camerapart.CFrame
local part = Instance.new("Part")
part.CFrame = CFrame.new(mouse.Hit.p)
part.Parent = workspace
camera.CameraSubject = part
part:Destroy()
end)
(I’ve seen the same forum but figured it wouldn’t work)
The camera type is on fixed, it aint gonna move like that, i dont remember whats the one who lets you move, but try to set it to others and keep testing them
ive tried all of them but none seemed to have worked
the camera cframe is being set to the camera part every frame, when you try to move it, its just gonna snap back
I feel like the closest ive got is with this
camera.CameraType = Enum.CameraType.Scriptable
runservice.RenderStepped:Connect(function()
camera.CFrame = camerapart.CFrame
camera.CFrame = CFrame.new(camera.CFrame.Position,mouse.Hit.Position)
end)
producing:
Only if the mouse isn’t locked but I want the mouse locked
you cant lock it on the center?
mouse position wont move if its in the center making it obsolete
you could try to hide the mouse, so it wont look weird
is there any way to stop the mouse from going off screen or hitting core GUI though?
would mouse delta work?
or userinputservice MouseMovement work?
i dont think there is, i would recommend try rewriting your code and try to find another way to do it, theres probably a easier way to it, sadly i cant help ya too much with this
Have you tried setting the camera type to scriptable?
Edit: You have.
So you what your asking is, that you want the camera to move, be able to fully look left & right while the player is stationary?
Not entirely sure on what you exactly want to achieve, so if this isn’t correct, please elaborate:
local UserInputService = game:GetService("UserInputService")
local RunService = game:GetService("RunService")
local camera = workspace.CurrentCamera
camera.CameraType = Enum.CameraType.Scriptable
local mouse = UserInputService:GetMouseLocation() -- get the initial position of the mouse
UserInputService.MouseBehavior = Enum.MouseBehavior.LockCenter -- lock the mouse to the center
local function updateCameraPosition()
local mouseDelta = UserInputService:GetMouseDelta()
-- Here, you can process mouseDelta.x and mouseDelta.y to move/rotate the camera.
-- For simplicity, we're assuming camerapart is a valid reference you've defined elsewhere.
local newCameraPosition = camera.CFrame.Position + Vector3.new(mouseDelta.x, mouseDelta.y, 0)
camera.CFrame = CFrame.new(newCameraPosition, mouse.Hit.Position)
end
RunService.RenderStepped:Connect(updateCameraPosition)
UserInputService.InputChanged:Connect(function(input, isProcessed)
if not isProcessed and input.UserInputType == Enum.UserInputType.MouseMovement then
updateCameraPosition()
end
end)
Just change the player’s camera’s max zoom the minimum. That’s literally it and no need for advanced scripts.
brother
camera like a actual camera (security camera)