hostnod
(TheTomato)
July 3, 2023, 6:39pm
#1
Hey guys,
I’m trying the prevent the player from looking all the way back in first person (like the player can only turn 90 degrees)
but I don’t know how to do this
I tried to look on the dev forum for solution but I didn’t found what I wnted.
After that, you should include more details if you have any. Try to make your topic as descriptive as possible, so that it’s easier for people to help you!
Quwanterz
(Quwanterz)
July 3, 2023, 6:44pm
#2
There are multiple topics similar to yours. Please search before posting.
its easy, only took me 30 minutes to write 19 lines of code
-- client thing
-- I dont know where
local RunService = game:GetService("RunService")
local Camera = workspace.CurrentCamera
local MinAngle = math.rad(-50) --the lower the lower you can see
local MaxAngle = math.rad(81) -- extra setting for fun
RunService.RenderStepped:Connect(function()
local YAngle = Camera.CFrame:ToOrientation()
local CorrectedAngle = 0
if YAngle > MaxAngle then
CorrectedAngle = MaxAngle - YAngle
elseif …
I don’t know how to explain so here’s a video.
I want the character to be limited to around 240 degrees of head movement. More than that should be blocked, so my Robloxian doesn’t get its neck snapped. I can’t find anything to help with my issue so I just posted it here.
The last few seconds of the video show my issue.
Shown game: https://www.roblox.com/games/7418604997/WW2-Stalingrad-Siberian-Front
Help would be appreciated!
hostnod
(TheTomato)
July 3, 2023, 6:50pm
#3
yea, I already tried the first one, but it not working as I expected and the problem with second one is that i don’t really understand.