Forum rules - please read before posting.

Action list only runs if it's under another game object in the hierarchy?

I just lost a couple of hours wondering why my Dialogue System test action list wouldn't work, when it turned out to be that Unity created it at the top level of the game objects. My other action list, Coin:Use (I'm doing the Unity demo), worked fine, but it's under the Coin object. So I put my Dialogue System test action list under an arbitrary white (not blue) object, and it worked. Anyone know why this behavior would happen? Thanks!

Comments

  • Sorry, can you clarify the set up? By "Unity demo", are you referring to Unity's adventure game, as covered in this tutorial?

    The location of a scene-based ActionList should be irrelevant, so long as the object itself is enabled. How are you running this ActionList? Screenshots showing your set up, as well as your AC/Unity version numbers will help in understanding the situation.

    You can click the "Run now" button in an ActionList's Inspector to test it out at runtime - try that to see if the issue lies with the ActionList itself, or if it's with however it's being triggered in the first place.

  • Thanks as always for the quick reply, Chris! Sorry for the lack of clarity. Here's what I mean:
    Yes, I'm using the Unity adventure game demo, and here's the setup of the Coin and its Use action list. Coin:Use is indented under Hotspot Coin in the hierarchy, and in this case, Coin:Use works.
    https://drive.google.com/file/d/1vWTkM3d_eGakiD3XHgpLBPyHOk5Yy3IE/view?usp=sharing

    And if I do this (move Coin:Use to the same level as Hotspot Coin), then Coin:Use doesn't run, even though I walk over to it and face it, the Run() in the code (I use the debugger a lot) never gets hit.
    https://drive.google.com/file/d/1GiY6tQAr9ZWM7sVt39an9HhClgjt_Bvf/view?usp=sharing

    I've done some customizations of code that might be causing this, I guess, so if this behavior makes no sense and you can just point me at the spot in the code where the code should make the call to run Coin:Use, that might be enough.

    Seems like the location of the action list in the hierarchy should make no difference, so this seems really weird to me.

    Thanks!

  • Indeed - it's not something that I can see should make a difference, either.

    I don't know what code changes you've made, but a Hotspot interaction is run within the PlayerInteraction script. Look for the line (around 1491 in the current release):

    button.interaction.Interact ();
    

    Running the ActionList's "Interact" function is what triggers it - see if a Debug.Log placed above it shows up with the correct value of "button.interaction".

  • Thanks Chris! I'll check it out.

  • For the record, I've never seen this happen again, so I think it was just an Editor bug.

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.