edited February 25 in General Support
Working through the NPC tutorial, when you talk to the NPC, if the collider isn't a perfect square, it rotates really weird. If you move the interactions components and collider off of the parent prefab (like how it is set up in the tutorial) and onto the child sprite object (the actual object that needs to rotate), it breaks the interaction and causes the character to not rotate at all. How would I properly set this up for NPCs that do not have a perfect square collider?

image
Post edited by Jayy8Bit on
  • edited February 25
    Edited this post to not include the old post since we aren't allowed to delete.
    Post edited by Jayy8Bit on
  • Figured out something that works. On the parent object, you need a 2d box collider with "Is Trigger" checked, and I sized it to cover the entire NPC. On the Sprite child object, you need another 2d box collider that is not a trigger, it'll just act as the normal collider, which I just have covering the knees down to the feet. I also changed the pivot point to Center in the sprite editor. Everything else is set up following the tutorials settings.
  • If you use a setup where the game object actually rotates, it'll naturally also rotate anything on it. The Face Camera component is used to keep a game object rotated toward the camera, so any collider on it will also keep that rotation in alignment with the sprite.
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
Sign In or Register to comment.