Lua 如何在Roblox第一人称视图中以编程方式调整旋转量?

Lua 如何在Roblox第一人称视图中以编程方式调整旋转量?,lua,roblox,Lua,Roblox,我们的目标是制作一个间谍游戏,这样它以第三人称视角开始,如果玩家按F键,它将变为第一人称视角。在第一人称视角下,它就像配备了一个双筒望远镜,有3个变焦级别(camera.FieldOfView) 想象一下,在我面前大约100英尺外有一所房子。当我在第一人称视图中时,我想单击键V以更改视野。我将有三个等级:50度,30度和10度 game:GetService("UserInputService").InputBegan:connect(function (input, _)

我们的目标是制作一个间谍游戏,这样它以第三人称视角开始,如果玩家按F键,它将变为第一人称视角。在第一人称视角下,它就像配备了一个双筒望远镜,有3个变焦级别(camera.FieldOfView)

想象一下,在我面前大约100英尺外有一所房子。当我在第一人称视图中时,我想单击键V以更改视野。我将有三个等级:50度,30度和10度

game:GetService("UserInputService").InputBegan:connect(function (input, _)
    if input.KeyCode == Enum.KeyCode.V then
        if player.CameraMode == Enum.CameraMode.LockFirstPerson then
            view_index = view_index + 1
            if view_index >= table.getn(all_views) then
                view_index = view_index - table.getn(all_views)
            end
            camera.FieldOfView = all_views[view_index + 1]
        end
    end
end)
我发现,当我移动鼠标时(鼠标垫上的距离大致相同),我的方向移动量大致相同,也就是说,它总是在整个房子中移动。我希望只有在30度视野的情况下才能穿过窗户,而在10度视野的情况下则能移动得更少。当我“放大”查看对象的细节时,我想对旋转进行更精细的控制。有什么方法可以做到这一点吗?

这是
游戏:GetService(“UserInputService”)…MouseDeltaSensitivity

local UserInputService = game:GetService("UserInputService")
UserInputService.MouseDeltaSensitivity = 0.1 -- or 1, or 0.01 for different sensitivity
检查这个