FreshRSS

Normální zobrazení

Jsou dostupné nové články, klikněte pro obnovení stránky.
PředevčíremHlavní kanál

When translating controls into German, do I assume a German keyboard?

I am translating a video game into German, and I am wondering about the keys listed for the controls in the settings. On an American keyboard we have QWE, AD, and ZXC forming a square that the player can easily use with their left hand, so those are default controls. But on a German keyboard the Z and the Y have switched places, so do I need to put a Y in place of the Z for the translation? Can I assume that German-speaking people are not using the American keyboard setup?

Why do my axis mappings to remap the MoveForward and MoveRight keys not seem to have any effect in-game on Unreal Editor 4.27.2?

Since I have an azerty keyboard instead of a qwerty one I'm trying to remap wasd to zqsd for the in-game playing in Unreal Editor 4.27.2.

I've started a new blank c++ project with starter content. Then I went to Project Settings -> Engine - Input -> Axis Mappings.

This is what my new axis mappings look like: enter image description here

However, no matter what, when clicking Play, the camera movements will only respond to wasd and completely ignore the axis mappings which I put there. I build, compiled and tried restarting the editor but to no avail. What am I missing?

  • ✇Recent Questions - Game Development Stack Exchange
  • Cannot read value of type 'Vector2' from WASD KeyControlFenrir
    I'm getting these error messages when I try to use Unity's new Input System package: Cannot read value of type 'Vector2' from control '/Keyboard/w' bound to action 'CharacterControls/Movement[/Keyboard/w,/Keyboard/a,Keyboard/s,/Keyboard/d]' (control is a 'KeyControl' InvalidOperationException while executing 'performed' callbacks of 'CharacterControls/Movement[/Keyboard/w,/Keyboard/a,Keyboard/s,/Keyboard/d]' Here is the code I'm using: using System.Collections; using System.Collections.Generic
     

Cannot read value of type 'Vector2' from WASD KeyControl

I'm getting these error messages when I try to use Unity's new Input System package:

Cannot read value of type 'Vector2' from control '/Keyboard/w' bound to action 'CharacterControls/Movement[/Keyboard/w,/Keyboard/a,Keyboard/s,/Keyboard/d]' (control is a 'KeyControl'

InvalidOperationException while executing 'performed' callbacks of 'CharacterControls/Movement[/Keyboard/w,/Keyboard/a,Keyboard/s,/Keyboard/d]'

Here is the code I'm using:

using System.Collections;
using System.Collections.Generic;
using System.Runtime.CompilerServices;
using TMPro;
using UnityEngine;
using UnityEngine.InputSystem;


public class PlayerMovement : MonoBehaviour
{

    private CharacterController _charactercontroller;
    [SerializeField] private Vector3 _walkDirection;
    [SerializeField] private Vector3 _velocity;
    [SerializeField] private float _speed;
    Animator animator;

    int isWalkingHash;
    int isRunningHash;

    PlayerInput input;

    Vector2 currentMovement;
    bool movementPressed;
    bool runPressed;

    void Awake()
    {
        input = new PlayerInput();

        input.CharacterControls.Movement.performed += ctx =>
        {
            currentMovement = ctx.ReadValue<Vector2>();
            movementPressed = currentMovement.x != 0 || currentMovement.y != 0;
        };
        
        input.CharacterControls.Run.performed += ctx => runPressed = ctx.ReadValueAsButton();
    }

    void Start()
    {
        animator = GetComponent<Animator>();
        _charactercontroller = GetComponent<CharacterController>();

        isWalkingHash = Animator.StringToHash("isWalking");
        isRunningHash = Animator.StringToHash("isRunning");
    }

    void Update()
    {
        handleMovement();
    }
 
    void handleMovement()
    {
        bool isRunning = animator.GetBool(isRunningHash);
        bool isWalking = animator.GetBool(isWalkingHash);

        if ( movementPressed && isWalking) {
            animator.SetBool(isWalkingHash, true);
        }
        if (!movementPressed && !isWalking)
        {
            animator.SetBool(isWalkingHash, false);
        }
        if((movementPressed && runPressed) && isRunning)
            {
                animator.SetBool(isRunningHash, true);
            }
        if((movementPressed || !runPressed) && isRunning)
            {
                animator.SetBool(isRunningHash, false);
            }
        
    }

    private void OnEnable()
    {
        input.CharacterControls.Enable();
    }

    private void OnDisable()
    {
        input.CharacterControls.Disable();
    }
}
❌
❌