Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do you make the camera position itself in front of the person and not be able to move it?

Asked by 5 years ago

So I want the player to not be able to look around with the camera unfortunately I don't really know how to do this. I am relatively new to coding and I know I have been asking a lot of questions so I am sorry about that.

Please Reply

Thanks

1 answer

Log in to vote
0
Answered by
RubenKan 3615 Moderation Voter Administrator Community Moderator
5 years ago

Set the camera every frame with RenderStepped from RunService, then simply disconnect the events.

local Connection = {}
Connection[1] = game:GetService("RunService").RenderStepped:Connect(function()
    workspace.CurrentCamera.CFrame = CFrame.new(--[[your pos & angle]])
end)

--However you want to stop the cam force
--eg with mouse click
Connection[2] = game.Players.LocalPlayer:GetMouse().Button1Down:Connect(function()
    Connection[1]:Disconnect()
    Connection[2]:Disconnect()
end)
0
could setting the CameraType to Fixed be another way of doing this? GoldAngelInDisguise 297 — 5y
0
no, but you can position the camera with the block GoldAngelInDisguise 297 — 5y
0
Ok can you answer the question for me by doing that HiHowAreYah5 19 — 5y
Ad

Answer this question