0 votes

I'm beginning to make a game and decided to use an input map to better support remapping and controller. Here's the issue, when I use the analog stick vertical axis for "movementup" and "movementdown" it reads out as a 0 at the extremes. So if you are halfway between the bottom and the middle, event.getactionstrength("movement_down") returns ~0.5 as it should. However if it is all the way at the bottom, instead of a 1 it returns a 0. This means that the player will stop moving if the analog stick is at any extreme, when in reality it should be moving at its fastest. Windows reads the gamepad successfully, and I've tried this with two different gamepads, getting the same result. (I'm on 3.2.3 stable if that helps pinpoint a patched bug or something)

EDIT:
I've done some more testing, and have some more to report. The issue also occurs on both a Switch Pro controller and a Xbox Wireless Controller, either wired or wireless. I don't have any PS4 controllers but from what I've gathered so far it would be the same. Curiously, the switch pro controller seems to have a range of 0-0.7, before zeroing out at the extreme, while the xbox controller has a range of 0-0.9, zeroing out at the extreme. Windows itself still reports the joysticks as functioning properly (can get the full range in the built-in tester). With this happening on three controllers from two different manufacturers I can confirm that this is some sort of engine issue.

Attached here is a video that should document the issue:
https://youtu.be/sLzB0BB46IU

Godot version 3.2.3 stable
in Engine by (12 points)
edited by

You are using event.get_action_strength, so i guess, you are reading this in _input?
can your post the whole _input method?

I also think its better is you use Input.get_action_strength in _process or _physics_process

func _input(event):
if event is InputEventMouseMotion and cap:
    curMovement = Vector2(0,event.relative.y*sensitivity)
    mouse = true
else:
    if event.is_action_pressed("pause"):
        if cap:
            cap = false
            Input.set_mouse_mode(Input.MOUSE_MODE_VISIBLE)
        else:
            cap = true
            Input.set_mouse_mode(Input.MOUSE_MODE_CAPTURED)
    elif event.is_action_pressed("movement_up") or event.is_action_pressed("movement_down"):
        mouse = false
curAxis = Vector2(0,event.get_action_strength("movement_down")-event.get_action_strength("movement_up"))

this is my input function. Get action strength returns the same if it is used in process or physics process, which is the strange analog stick behavior

Please log in or register to answer this question.

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.