Whenever you use the keys "<" and ">", ROBLOX rotates your camera by 90 degrees in its respective direction. Is there any way to prevent this?
An alternative would be to copy the default control scripts and modify them slightly. Here's a step-by-step:
CameraScript
found under game.Players.Player.PlayerScripts
.game.StarterPlayer.StarterPlayerScripts
. This will replace the default camera script whenever the player enters the game. Now you can start editing.CameraScript.RootCamera
. You should see something like this, starting at line 494:--[[elseif input.KeyCode == Enum.KeyCode.Comma then local angle = rotateVectorByAngleAndRound(this:GetCameraLook() * Vector3.new(1,0,1), -eight2Pi * (3/4), eight2Pi) if angle ~= 0 then this.RotateInput = this.RotateInput + Vector2.new(angle, 0) this.LastUserPanCamera = tick() this.LastCameraTransform = nil end elseif input.KeyCode == Enum.KeyCode.Period then local angle = rotateVectorByAngleAndRound(this:GetCameraLook() * Vector3.new(1,0,1), eight2Pi * (3/4), eight2Pi) if angle ~= 0 then this.RotateInput = this.RotateInput + Vector2.new(angle, 0) this.LastUserPanCamera = tick() this.LastCameraTransform = nil end]]
comment these statements out (I did it for you already). This should unbind the ,
and .
keys from controlling your camera!
There's no real way to disable keys that are being used by roblox. You can try assigning the key to do something, but it won't really do anything.
You can use ContextActionService's BindAction method to get input from these keys, which will block ROBLOX's camera manipulation code from receiving them. Also keep in mind that they use the comma and period keys, not their shifted alternatives greater than and less than.