Forum rules - please read before posting.

NPC hotspot placement

edited January 2021 in Technical Q&A

I recently moved all my NPC hotspots to be direct children of the NPC prefab game object (as opposed to children of the SpriteChild game object). I did this to avoid this problem:
https://adventurecreator.org/forum/discussion/10912/followsortingmap-and-actionteleport

Moving the hotspots results in another issue regarding the Box Collider of the NPC hotspot. The issue can be reproduced as follows:
1. When the scene starts, move the NPC to the far right of the scene (using a Character move action)
2. Notice that the hotspots BoxCollider is still correct
3. Exit the scene (by walking into another scene)
4. Re-enter the scene
5. Notice that the hotspots BoxCollider is no longer correct (usually it's too narrow and if the player walks far enough away it disappears totally so it can no longer be clicked)

Comments

  • If your physics components are not parented to your sprites, be sure to uncheck Turn root object in 3D? in the NPC Inspector.

  • "Turn root object in 3D" is off. Here's the hierarchy:

    Root (NPC, Circle Collider)
        Sprite (Sprite, Follow SortingMap, Animator)
    Hotspot (Hotspot, Box Collider)
    
  • edited January 2021

    Your reproduction steps are not enough - what is the NPC's full Inspector, and state of their Transform before and after the issue occurs?

    A repro package would be best, if you can provide.

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.