Forum rules - please read before posting.
Tech questions during the weekend? Drop in on the community Discord channel!

Ui question

edited June 2019 in Technical Q&A
Hi, i was looking any tip or example for what i want to do.
I need in the UI use the instantiated buttons that i have and connect with the correct dialogue option.
Example: i have a lot of room i select where I'm going. Select x room. A UI with the zoomed Room with 5 icons of the objects of the room you can interact. One object if you click give a dialogue response. Other give the item or other start a conversation.
Any help will be nice but it will be perfect an example.
Thanks

Comments

  • If your UI is connected to AC's Menu Manager, you can control the handling of Buttons within the Menu Element's properties.

    However, you don't need to connect a UI Button to AC just to run an ActionList. Any ActionList asset can be run by calling its Interact() function. This can be done via the UI Button component's "On Click" event panel.

  • Oh i get the idea. The problem its that the buttons are instantiated depend the objects of the room.
  • It's possible to modify the "On Click" events through script. See Unity's docs/forums for more on this - that isn't strictly AC-related.

  • And if i want a hotspot with different options? In the instantiated buttons??
  • Different options like what? You can still use AC variables in your ActionLists, or use scripting to change which ActionLists the buttons link to. Without more details, though, I can't suggest much.

  • edited June 2019
    Imagine that the button its has the icon of a table and you want to look the table or hide. Or if it is a tv, just turn on/off, pick up, or look.

    Take a look from here:
    https://drive.google.com/file/d/1-AARl8OdPSNDyRyoDe7HwoiFqI9XeAjN/view?usp=drivesdk
  • Access is denied.

    But are you talking about Hotspots or UI Buttons? They are not the same thing, and Hotspots cannot be attached to buttons.

  • I was talking the best thing to do. If i can do with a button ui or a hotspot. I know are different but never do something like that in a UI menu. You have access now.
  • edited June 2019

    I'm afraid I really don't understand what the image is supposed to be showing me.

    You'll need to be more clear and direct about what your issue is. Your example of a button that can hide/show an object can already be done with ActionLists - regardless of whether it's run from a UI Button or a Hotspot. To change the appearance of the button, you can use animation.

    Hotspots too can be instantiated at runtime, and the new Variables component means you can now access variables attached to GameObjects / prefabs without having to first declare them in the Variables Manager.

  • edited June 2019
    So you can use hotspot in a ui? Becouse i think that its more ussefull. If Is that so only attach the hotspot into the instantiate image and a collider??
  • edited June 2019

    Colliders aren't designed to work with UI. Attaching a Hotspot to a UI component won't make things work instantly, but you could feasibly connect a Button's click event to run e.g. a Hotspot's "Use" interaction.

    See the included "Custom interaction system example" script for a demonstration on how Hotspot interactions can be invoked through code.

  • Thanks now i get the idea and it´s working

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.