Forum rules - please read before posting.

Keyboard and controller movement issue

Hello AC developers,

I am trying to make an isometric game. I want to use the Keyboard or a controller and that is what I chose as Input Method. The movement method is Direct. The problem is when I hit for example right, the character first moves a little in the Y (vertical) and X axis (like a semi-circle) and then moves to the right. This also happens when I press left, up or down.
However, if I change the movement method to point and click and the input method to mouse and keyboard and I click it works perfectly fine (the keyboard doesn´t work). The thing is that I want to use a Keyboard or controller.

Also, when my player reaches the limit of the navmesh and I keep pressing the movement key, the players doesn´t stop but keeps "moving" like slowly dragging itself along the wall.

I have checked and changed values but I can´t find a solution that works. My AC version is v.18.2 and Unity 2022.3.18f1

Thanks.

Comments

  • The turning behaviour of characters under Direct control has its own setting - Turning mode under the Settings Manager's "Movement panel".

    Set this to Independent to prevent vertical movement when using horizontal inputs.

    when my player reaches the limit of the navmesh and I keep pressing the movement key, the players doesn´t stop but keeps "moving" like slowly dragging itself along the wall.

    Is the wall completely vertical while movement is horizontal? Any screenshots you can share to illustrate the issue will help clarify the situation.

  • Hi,

    Thanks for the solution to the movement issue. Now it works better.

    Is the wall completely vertical while movement is horizontal?

    Sorry, I think I misexplained myself. It is an isometric game, so the navmesh encompasses the floor in order to stablish the limit of the area; the walls are just part of the room image and have no Colliders2D on them. I think is something related to the Phisycs Material 2D, because even when the player moves there is a soft drag, like it has some weight, but I can´t seem to figure it out. I am not using the rigidbody movement. I will keep you updated.

  • If you don't rely on physics/colliders, a 2D Player will limit their Direct movement to the NavMesh if Auto-stick to NavMesh?.

    This option won't rely on the use of Physics Material 2Ds, but instead just snaps the Player to the NavMesh if they leave. If you approach the edge at an angle, you will get a "sliding" effect but it's not one that can be controlled. For this, you'd need to rely on regular Rigidbody/Collider components.

  • edited April 7

    I am using the Autostick to Navmesh? option, yes. The thing is don´t want to move the Player with the Rigidbody to avoid physics, however I need it for the triggers to detect the player and work (I am using them to change and move to the different parts of the scenario). I turned off the "Move with rigidbody" option and set the Rigidbody to Kinematic (otherwise the Triggers2D won´t detect it), however, when moving, the character "weights", meaning it takes a little to him to start moving and when it stops it slides a little (for a second), and I don´t want that. I just want it to start moving when pressing the key and then stop when releasing it, no physics.

    (From the manual)When input is released, the Player will continue moving towards the direction that the input was last indicating. This effect can be disabled by checking the Stop turning when release input? option.

    No effect with this one.

    I changed the movement method to point and click and the input method to mouse and keyboard and it works perfectly, but in this one I want direct movement.

    One more thing related to another topic. As I am not using the mouse, I am trying to toggle through the invenytory items but I can´t find a way to do it (I am trying to find the key input without any luck.). I would like it to be the Tab key for example.
    I just need them to be selected to work with the hotspots (Inventory: check selected).

    Thanks.

  • The thing is don´t want to move the Player with the Rigidbody to avoid physics, however I need it for the triggers to detect the player

    Triggers have two means of detecting objects.

    Set its Detection method to Transform Position, and detection will be based on the origin position of the Player - the Rigidbody is not necessary.

    No effect with this one.

    I'm not clear - is this in an effort to solve a new issue? The "Stop turning when release?" option works as intended.

    As I am not using the mouse, I am trying to toggle through the invenytory items

    Menu interaction through direct input depends on your Menu's Source.

    If set to Adventure Creator, the left-click equivalent is the "InteractionA" input. If set to Unity UI, it's "Submit" (as set in the Event System).

    The Manual's "Navigating Menus directly" chapter has more details.

    1. Well, I solved the character issue. It was strange because I deleted it, created a new one and it worked like a charm.
    2. The inventory is another thing. I have spent these days revisiting tutorials (this one for example Adventure Creator: Recreating Unity's adventure game) and checking this forum threads, and I can´t find a solution. In the end, I decided to stick to Adventure Creator as the Source for my inventory. My idea for the game is to be able to select the items during the gameplay to interact with the hotspots (Inventory: Check Selected). If the item is not selected the hotspot just makes a sound as a hint that you need something to interact with it. I know it is almost similar to the choose hotspot then interaction **option, however I want to force the player to think and select the item. The thing is that I can´t find a way to toggle through the items - with the , or . keys for example -. I am testing the hotspots via the **Inventory: Carrying specific item. and they work fine, and if I can´t find a way to select the items I will leave this option, even it is not the one I want.
  • Sorry, I'm not 100% clear on your intended behaviour.

    Are you looking to select items before any Hotspot interaction, or you do want to e.g. press an input once a Hotspot is in the vicinity, have the Inventory menu open, and then choose an item to use on the Hotspot?

    The latter is "Choose Hotspot Then Interaction" mode - I'm not sure how that differs from what you're going for. If you're using that mode, you can uncheck Only show items referenced in Interactions? in your Interaction menu's InventoryBox element to have it show all items, as opposed to only those with Interactions defined by the current Hotspot.

    Navigating the Interaction directly can be done with inputs named CycleInteractionsLeft and CycleInteractionsRight - see the Manual's "Choose Hotspot Then Interaction" chapter for details.

    Otherwise, if it's a regular Inventory menu, you'd need to enable direct menu navigation. If the Menu is open during gameplay, use the Engine: Manage systems Action to allow it during the intended time (i.e. when it turns on). This will cause the regular Horizontal/Vertical inputs to be used for navigation, so you'd likely want to also use this Action to disable the Movement system at the same time (to prevent the input also being used for Direct control of the Player). More on this can be found in the Manual's "Navigating menus directly" chapter.

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.