Jump to content

Recommended Posts

Posted

English:

Is there a way to switch directly from first-person view to third-person view?

The game’s default camera is first-person view. Pressing F5 switches to second-person view, and pressing F5 again switches to third-person view. Is there any way to switch directly from first-person view to third-person view?

Does the game have any in-game commands for switching camera perspectives? For example, the commands “.clientConfig musicLevel 0” and “.clientConfig musicLevel 100” can be used to disable or enable background music. If there is a command that can directly switch to third-person view, it could be bound as a hotkey using the in-game macro editor opened with “Ctrl+M”, allowing one-key switching to third-person view.

 

原文:
请问如何从第一人称视角直接切换到第三人称视角?

游戏默认视角是第一人称视角,按F5可以切换到第二人称视角,再按F5可以切换到第三人称视角。有没有办法直接从第一人称视角切换到第三人称视角?

游戏内有没有切换视角的指令?比如“.clientConfig musicLevel 0"和”.clientConfig musicLevel 100“指令可以开启或关闭BGM,如果有能直接切换到第三人称视角的指令,就可以通过游戏内“Ctrl+M”调出来的宏编辑器制作成快捷键,就可以一键切换到第三人称视角了。

  • 1 month later...
Posted

Fairly sure there isn't any command for that. Not sure why you would even need this but would be fairly simple to make a custom hotkey for this from code.
 

public class SandBoxModModSystem : ModSystem
{

    [UnsafeAccessor(UnsafeAccessorKind.Field, Name = "CameraMode")]
    internal static extern ref EnumCameraMode CameraMode(Camera instance);

    public override void StartClientSide(ICoreClientAPI api)
    {
        base.StartClientSide(api);

        api.Input.RegisterHotKeyFirst("toggle-first-third-person", Lang.Get("Toggle between first and third person"), GlKeys.M, shiftPressed: true);
        api.Input.SetHotKeyHandler("toggle-first-third-person", input =>
        {
            
            if(api.World is ClientMain client)
            {
                ref EnumCameraMode cameraModeRef = ref CameraMode(client.MainCamera);

                cameraModeRef = cameraModeRef switch
                {
                    EnumCameraMode.FirstPerson => EnumCameraMode.ThirdPerson,
                    _ => EnumCameraMode.FirstPerson
                };
            }
            return true;
        });
    }
}

 

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.