Right now i want to look around like this
but the best I got was this
I cant find any dev forums on how to do it either.
PLEASE help, thank you
Right now i want to look around like this
You can simply do that by changing the CameraSubject
property in the camera instance.
what would I change it to though?
if i got it right, you want to make so the camera moves around the player like a third person shooter for example. You can do that by locking the mouse in the center.
you can use this:
game:GetService("UserInputService").MouseBehavior = Enum.MouseBehavior.LockCenter
you can also hide the mouse if ya want, so it doesnt get in the way
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:
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:
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