Forum rules - please read before posting.

Movement keys acting up

edited August 2021 in Technical Q&A

I'm using a direct movement method with Keyboard or Controller input method.

I followed your tutorial on how to integrate Unity's new input system package, and added the script to the scene with the key bindings.

Mostly, moving left and right (the only two directions the character is supposed to move, btw) works fine, but every so often it gets wonky. Sometimes the character doesn't move at all for a little while, and at times it continues to move indefinitely even after I let go of the key. Any ideas what could be causing this?

Btw In your input script I have put "2d vector" under Movement Action. I played around with "mode" but no improvement here.

Comments

  • Welcome to the community, @Divaraf.

    What are your AC and Unity versions, is this for a 2D or 3D game, and does your character rely on root motion?

    To be clear: you've gotten the integration script from the wiki?

    We'll need to determine if this is an issue with "vanilla" input. Were things all working before using the new Input System package? If you're unsure, it'll be worth temporarily reverting back to it to test.

    If so, what is your "Active Input Handling" set to in Unity's Player settings? (See this page for details). If its set to Both, I wonder if it may be that both are being used at the same time.

    If the character is only supposed to move sideways, are you enforcing that by not defining vertical inputs, or through use of the Player: Constrain Action? Share some screens of your bindings, and I'll try to see what's what.

  • Thank you!
    I'm using AC v1.73.8 and Unity 2021.1.
    Yes the integration script is from the wiki.

    The Active input handling is set to the new one only.

    Right now I'm not using any animations, I only have a placeholder sprite that slides left and right. Can that cause troubles?

    Right now I don't even remember how I got it to move sideways - and now I can't find the relevant settings - but I haven't used the Player: Constrain action, that much I know.

  • edited August 2021

    Is this for a 2D or a 3D game?

    I only have a placeholder sprite that slides left and right. Can that cause troubles?

    No - though if you have an Animator component attached, make sure that "Apply Root Motion" is unchecked.

    If you can, please try my suggestion of trying it without the new Input System - so that we can determine where the source of the issue lies. Screens of your bindings, character's Inspector and scene would be great, too, as it'll help me understand the specifics of your situation.

  • Alright, sorry for being a terrible troubleshooter, but I played around with some settings without duly noting what I did, but the problem is now gone and I can't reproduce the sliding/halting any longer, so for now the issue is resolved!

  • Back again :/
    Ok so this problem has returned. At first I thought it had to do with only movement, but after I started playing around with menus, and navigating through them, I noticed the problematic behaviour is there too, meaning I sometimes press a key a nothing happens for several seconds, and other times the game acts as if I'm holding a key down.
    Roughly 1 time in 5, the game starts non-responsive for some 4-5 seconds before it reacts to input.

  • I'll need results of my earlier suggestions, in that case:

    If you can, please try my suggestion of trying it without the new Input System - so that we can determine where the source of the issue lies. Screens of your bindings, character's Inspector and scene would be great, too, as it'll help me understand the specifics of your situation.

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.