Forum rules - please read before posting.

Help with the AC combat example for mobile

I took the combat example and adapted it as 2.5d with a pre-rendered background a long time ago. I added a few buttons to the joystick and adapted it for mobile. Some problems appeared;

The first one, I placed about 7 of these buttons and only the input on the button ''InteractionA'' and the Input ''Inventory'' and the other inputs such as ''Aim'', ''Reload'' and "Fire1'' worked. They don't work on the buttons, but they work on the NotBook keyboard. I reviewed the ''input manager'' and didn't see any problems there.

And the buttons are all linked in joistickUi.

To move the items in the inventory I put two buttons, one for right and left and that doesn't work either I used the ''Horizontal'' input.

Anyway, what configuration do I use for the mobile using the joystickUI in this combat example?

«1

Comments

  • As seen in the video, in the inventory the two top right and left buttons do not work and you need to press a computer key for the ''InteractionA'' input to work and even then it does not allow you to select the knife.

  • Those two right and left buttons to appear only within the inventory, I thought about using menus and actionLists instead, but I don't know how to use Input to move inventory items.

  • I'll attempt a recreation. Can you show the configuration of your updated JoystickUI?

  • edited November 2023

  • All buttons were duplicated from one, so they all have the same settings, each button has an event System.

    Of all the Inputs, only two work on the ''InteractionA'' and ''Inventory'' buttons.

  • When collecting the key, it is not responding after the question appears on the screen ''yes'' and ''no'' on the mobile phone, it does not respond to touch and the player is frozen

  • I have updated the Combat Example package with the ability for it to respond to inputs from the Mobile Joystick UI template.

    For inventory-scrolling, use Buttons mapped to inputs named ShiftInvLeft and ShiftInvRight.

  • For the yes/no prompt, you'll need to disable the Direct-control Menus options at the top of the Menu Manager. You may need to temporarily set your Input method to Mouse And Keyboard for these options to visible.

  • I did this and it worked, the ''Yes'' and ''No'' prompt is clickable and responds and scrolling through the inventory also works. I installed the game on my cell phone, however on my cell phone there are some problems. If you click at any point on the screen, it only responds to inspecting the item, and the analogue does not select the item's options (Inspect-take-Open-Equip), making it impossible to click on the option. In Unity this problem does not occur in the inventory.

  • Do two things:

    1. Open up the combat example's CustomInventory script, and comment out / remove line 146:

      KickStarter.playerInput.forceGameplayCursor = ForceGameplayCursor.KeepLocked;

    2. To the Interaction_TurnOn ActionList, add a Player: Constrain Action that sets the Cursor lock to Disabled.

  • I made the change, in the script and in the actionsList. It doesn't have any effect, there also seems to be a conflict with the analogue because depending on how it is pressed after selecting the item, it hardly changes between the options (inspect - take - open - equip).
    In Unity this does not happen.

  • By "analogue", do you mean the on-screen joystick? I'm not clear on the exact behaviour you're describing.

    You'll need to choose between either using that to select options, or pressing them directly - it can't do both at the same time.

    Your Settings Manager above has its "Input method" set to "Keyboard Or Controller". Are you setting it to "Touch Screen" when running a build?

  • edited December 2023

    With the game installed on the cell phone, it is not possible to complete the item selection. When I press the "InteractionA'' button, the button selects the item, then the ''Inspect or Equip'' options appear, as Inspect is already highlighted, if you touch any point on the screen it just scrolls the ''Inspect'' message of item.

    Regarding the Joystick in the inventory, it works well to scroll items, but it is not working to highlight between the ''Inspect or Equip'' options.

    I changed it in some configuration that I don't remember, before it appeared as seen in the video above ''Inspect - take -open -Equip'' and now only ''Inspect and Equip''.

    The settings I used in Settings Manager are;

    Direct,
    Mouse and Keyboard
    Choose Hotspot thein interaction
    Clicking menu
    Via Script Only

  • edited December 2023

    Your Settings Manager above has its "Input method" set to "Keyboard Or Controller". Are you setting it to "Touch Screen" when running a build?

    I tried these two, they didn't work either. Both modes did not select the item. Button ''InteractionA'' did not work in the inventory.

  • edited December 2023

    Return to the CustomInventory script, and comment out the line:

    KickStarter.playerInput.canKeyboardControlMenusDuringGameplay = true;
    

    Are interaction options directly click/tappable then?

  • I commented the line of code and no changes. In the video, when an item is selected. I had to click several times on the right on the joysticUi analogue to change from ''Inspect'' to ''Equip'' after which I was able to equip the weapon by clicking on any area of ​​the screen.

    JoysticUi analogue within the inventory does not seem to respond after selecting an item.

    In unity this problem does not occur, it works fine.

  • Are interaction options directly click/tappable then?

    In the menu, options are touched on the screen, anywhere on the screen and not on the option buttons.

    Outside the menu, it's different when you pick up the key, for example. When approaching the key, instead of clicking on the Joistick button, it is at any point on the screen to enter the ''Yes'' and ''No'' prompt and from there you can click on ''Yes'' or '' ''No''.

  • edited December 2023

    Outside the menu, it's different when you pick up the key, for example.

    Best to deal with one issue at a time - we'll come back to that after the Inventory.

    The code you've commented out is to do the opposite of what you're trying to do in your video, i.e. select with the joystick, as opposed to pressing the interaction buttons directly.

    I need to be clear: which of these two methods are you looking to make use of in order to select Interaction options? If you want to use the joystick, the code will need to be un-commented.

  • The code you've commented out is to do the opposite of what you're trying to do in your video, i.e. select with the joystick, as opposed to pressing the interaction buttons directly.

    None of these options are working. It is not working if you click directly on the ''Inspect'' or ''Equip'' button. The choice buttons are only activated in this case if you click on any part of the screen,
    making it impossible to click directly on these options.

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.