Hi, how can I change the direction of an NPC at the start of the scene. My NPC's all look to the right/east. The problem is that the CombantController is set so that the IdleStart direction is right/east. When I change the order in the controller, the NPC stands correctly, but when I start a conversation with the player, it turns in the wrong direction.
I have read through the tutorial 2D Rpg Quickstart, but can't find a solution.
What can I change so that the NPC's look in the direction I tell them to?

Sorry for my bad english.
  • If you've followed the tutorials setup, the NPC is set up as a combatant, i.e. using the combatant's animation setup.
    Direction in the tutorials setup is bound to the Z-axis rotation, so if you want the NPC to look into a different direction, you just need to change the Z-axis rotation of it's game object. It'll look strange in the scene setup (since you just rotate the sprite), but once you play the animations will take over and show the correct sprite and orientation.
    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!
  • edited November 27
    Thanks for the help.

    It looks really strange, but it works.
    Now I have another problem. The NPC's box collider also rotates in the Z-axis, which means that I can run into the NPC with my player.

    When I start the game, the boxcollider is in the default position (Z-Axis 0), but when I turn the NPC so that it looks down (Z-Axis -90), the boxcollider is rotated by 90°.

    I have the same problem with the player.
    Post edited by Daalaff on
  • The box collider should be on the child object with the sprite (or a child object of that), since that'll be rotated toward the camera (via the face camera component) and keep it's correct rotation, even if the parent rotates on the Z-axis.
    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.