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

Clicking on an NPC

Sorry for noob questin, its been a while since Ive workd with AS, this seems so basic, and I think Ive followed the tuts, but...
An NPC is walking. triggered by a cutscene that is placed in On Start Cutscene slot.
He has a hotspot component and a highlight component attached.
I can roll over him and get a highlight and name tag, but when I click nothing happens, no Interaction is triggered. Currently I just have a Character Move along path/Stop moving Interaction set up, for testing. (Actually I want to start a conversation, but of course stopping him on his path is the first thing that should happen.
He dosnt stop

I dont feel that the interaction is happening (Plus theres no yellow box showing despite having that checked)

Comments

  • What are your AC/Unity version numbers? And is this a 2D or a 3D game?

    With only a single Action in your ActionList, it's not enough to determine whether the Interaction is running at all, or if the issue lies with the Action.

    Create an additional ActionList: Comment Action that outputs some message to the Console. You can then look for that showing up when it's supposed to run.

    Then try running the Interaction ActionList manually at runtime via the "Run now" button in its Inspector.

    If it works as intended, the issue is likely with the Hotspot - in which case, share some screens of the NPC's full Inspector. If he's 2D, make sure that the Hotspot is either on the sprite child (with a 2D collider for the Hotspot's shape) or keep it on the root but uncheck Turn root object in 3D? in the NPC Inspector.

    If it doesn't work as intended, the issue is likely with the ActionList - in which case, share screens of both the OnStart and the Interaction ActionLists.

  • Hi Thanks!
    OK pressing play in the action list editor works as expected, including the newly added comment as you suggested.

    If it works as intended, the issue is likely with the Hotspot - in which case, share some screens of the NPC's full Inspector.

    Heres the Hotspot and Highlight

    Here they are: First NPC component

  • Where is the Hotspot component in relation to the NPC root, and what is the state of the Hotspot component at runtime? It should tell you its enabled state in the Inspector.

  • edited February 19

    Hmm.. Maybe thats it? QUestion is, where do you consider the root? On the Transform/Animator? or on the model, cos I have many un-enabled models under one game object, to make character choices easier. (Its a Cyberpunk/VR world, where you can change your appearance- I didn't want to do this through player switching as its a bit too much stuff to do over and over, if i need 20ish characters)

    Incidentally, I got some ok functionality just now, simply by enabling "Single "Use" interaction" on the hotspot component. But as it was a bit wonky without that checked, Im wondering if it's correct?

    But here's the hierarchy.

  • If you're placing it on a GameObject that gets disabled, then it won't work. Child objects shouldn't affect it otherwise, though.

    I'm still not clear where exactly you're placing it - please answer both my questions above.

  • Sorry, I thought that was shown above in the image.
    There is a main Game Object, on which all components are living. Thats shown as "Alien Blue" above. As a child of that there's multiple models, but only one is enabled. And no, it doesn't get disabled. On the NPCs in the game I simply use this technique to populate the world with different characters without having to make multiple NPC prefabs, I can simply place them in the scene and change the model. The components respect the child model as they are in the parent.

    As far as your second question,

    and what is the state of the Hotspot component at runtime?

    I don't really know what you mean. Yes its enabled. but should there be some indicator there on runtime?

  • should there be some indicator there on runtime?

    If the Hotspot is off at runtime, then a "Current state: OFF" will appear in its Inspector.

    If it works when Single 'Use' interaction? is checked, though, it sounds more like the issue is to do with your regular way of triggering Interactions.

    How are you looking to have the Hotspot be interacted with? Via an "Interaction" menu that appears upon clicking the Hotspot? Let's see your Settings Manager's "Interaction settings", and the properties of your Interaction menu if so.

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.
Do NOT follow this link or you will be banned from the site!