When I tried to add a custom interaction yesterday, I noticed that it didn't instantly work as expected.
I am using Unity UI. I followed the guide for adding custom interactions:
Copy existing Action - for example "Look at"
Paste after
Duplicate interaction button ion the interaction interface
Link this button in the new interaction
When I started the game and tested this (with choose hotspot then interaction), my action wasn't exectuted.
Instead, the "Look at" interaction was executed by both interaction buttons.
Only after I switched to Adventure Creator UI and back to Unity UI, it worked as expected. I didn't have to change anything else to make it work.
It would be great if the Unity interface would work instantly without having to switch.
Questions:
1) Is this a known issue and can we hope for a bugfix?
2) Or do you actually recommend to stick with Adventure Creator UI?
3) If yes, can I style this visually according to my needs, like I'd do it with the Unity UI? (this is why I switched to Unity UI from the start, because I need to be able to do this)
4) It would be great to have a preview of the UI while adjusting it via the manager when its set to Unity UI as well, like when its set to AC. But I guess you won't (maybe can't?) add this functionality?
It looks like you're new here. If you want to get involved, click one of these buttons!
Comments
It is not a known issue, but rest assured if it is a bug then it will be fixed.
I cannot recreate the behaviour on my end, however. What are your AC and Unity versions?
After duplicating the Interaction element in the Menu, are you setting its Cursor/icon field to the new Cursor icon you earlier defined in the Cursor Manager?
If you could share a video of the steps you're taking, that'll help clarify the exact situation.
I recommend using Unity UI. The Adventure Creator source option can often be easier/faster for rapid-prototyping, but the styling options that Unity UI offers makes it the better choice for final design.
AC Menus have their styling options within the Menu Manager, but they're more limited than Unity UI ones. It depends on exactly what visual changes you want to make.
It's a different way of working. When using Unity UI, adjusting options in the Menu Manager won't affect the UI outside of Play mode. You can keep the UI prefab open in the Scene window while working, but the link between the two can only occur once you play the game.
I am using Unity 2022.3.19f1 and the current AC version 1.81.6 - will see if I can write down or show a better reproduction of this behaviour later.
Since I'm just starting out with AC, of course I cannot be 100% sure that I didn't forget anything.
The correct icon was shown in the menu when it was set to Unity UI, but when I set it to AC, it showed the icon from the copied interaction instead. Switching back to Unity UI, it showed the correct icon again.
Switching source shouldn't affect the assigned icon. I still can't reproduce such behaviour, however, so any steps/media you can share to clarify the actions taken will be welcome.
Hm, weird. I just wrote down a step by step reproduction of what I remembered doing when setting up my interaction, and repeated to create the custom interaction.
And I couldn't reproduce the problem. Maybe I actually forgot replacing the sprite/icon on the first (and second!) try, thinking it can't be important because it's just a placeholder image?
Anyway, everything worked for me this way:
1) At first I created a new Icon under "Cursor". It's called "CustomInteraction"
2) I choose a sprite for this cursor.
3) In Menus (Menu 6: Interaction elements), I click on "Look"
4) Then click on the cogwheel next to it and "copy"
5) Again click on the cogwheel, press "paste after"
6) Now there is a "Look (Copy)" Interaction. I rename it to CustomInteraction
7) and set its Cursor to "CustomInteraction".
8) The linked Button is "btnLook" in the InteractionUI Prefab.
9) So I open that, duplicate it and call it "btnCustomInteraction".
10) In the inspector of this btn, I set the same Interaction Sprite from the Cursor as Source Image.
11) In the Hotspot Inspector, I add a Use interaction.
12) I set the Cursor to Custominteraction and add (create) an interaction.
13) With "Edit Action" I choose Action Type Dialogue (player line) and enter some text.
14) I save and start the game.
15) On hover over the Hotspot, the interacton menu opens and my custom Icon is shown right next to "look at".
16) At first I click on "look at" to see if this still works. Everything is fine.
17) I click on my custom interaction button in the menu - it works as well!
Everything is fine
Sorry for bothering you with this.
If I stumble on this again and find out if there is a problem in this procedure, I'll come back to this thread.
But for now I guess I just forgot some important step before.
I'll just leave my steps here, since sometimes other users find this later and it may help in some way, hopefully.