Forum rules - please read before posting.

Clicking on a moving NPC

Hi, Im trying to learn a little 2D Adventure Creator.
I have an NPC (a mouse) that patrols back and forth in a street. Im using a looping path for that. I want to be able to click on it, and stop the path. At this point I will initiate a dialogue with the mouse.
I tried adding a hotspot, parenting it to the mouse (removing it from the Hotspot folder to do this). But when it walks its very difficult to get the hover over label text to show at all, I do see it occasionally, but only briefly (the merest flashes) and only when he's walking ONE WAY down the street.

Is there a better way. Weirdly Ive never tried this in my other 3D games either, NPCs have always been static, and not walking. I envisage being able to do this as an important element to my games (both 2D and 3D) in order to interact with a bunch of NPC that are just wandering about normally.

Comments

  • You need to ensure that the Hotspot is on your NPC's sprite child (or on a child object of it).  The root object of 2D NPCs rotate in 3D space as they move around, whereas the sprite child compensates by rotating the other way - to ensure it's always facing the camera.

    This also means that any colliders attached to the sprite child will also be correctly facing.  You don't need to add a Hotspot prefab onto the NPC - so long as your NPC's Sprite child has a Box Collider 2D attached, adding the Hotspot component will be enough.
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.