Thursday, November 24, 2022
HomeGame Developmentunity - InputSystem behaves in a different way in Construct and Editor

unity – InputSystem behaves in a different way in Construct and Editor


I am attempting to map WASD, Arrow Keys and Gamepad Left Persist with digital camera motion.

enter image description here

So A/Left arrow is unfavorable, D/Proper arrow is constructive.

I’ve had points with the UI attempting to devour these key presses, so for the second I’ve deleted all UI actions and disabled occasion consumption.

I am polling the axes in a technique invoked from Replace():

non-public void HandleInput() {
        var movementInput = new Vector2(
            plumbing.Controls.GalaxyMap.MoveLeftRight.ReadValue<float>(),
            plumbing.Controls.GalaxyMap.MoveUpDown.ReadValue<float>());
        HandleMovement(movementInput);

        var rotationInput = new Vector2(
            plumbing.Controls.GalaxyMap.RotateLeftRight.ReadValue<float>(),
            plumbing.Controls.GalaxyMap.RotateUpDown.ReadValue<float>());
        HandleRotation(rotationInput);

        //Debug.LogFormat("Transfer {0}, Rotate {1}", movementInput, rotationInput);
    }

This works completely within the editor, nevertheless, after I construct the sport, urgent A ends in shifting proper when it ought to transfer left. Urgent D additionally strikes proper.

Left arrow works as anticipated, however each A and Left arrow are configured identically…

enter image description here
and
enter image description here

The debug output exhibits that MoveLeftRight.ReadValue() is returning +1 for the axis when it ought to be -1.

There aren’t any different indications something is mistaken/uncommon.

Why is it flipping one half of the axis at runtime? How can I stop this?

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -
Google search engine

Most Popular

Recent Comments