Search Unity

A* Pathfinding Child Repositioning

Discussion in '2D' started by Fareigner, Sep 20, 2017.

  1. Fareigner

    Fareigner

    Joined:
    Sep 4, 2017
    Posts:
    1
    Hello,

    I have a map that uses A* pathfinding, with a sprite that navigates it. I have 2 questions:

    • How do I prevent the sprite child from rotating with the parent AI?
      • (I have a script already that sets an initial rotation angle, then updates transform.rotation to that value every frame, the problem being it still causes a slight rotation when changing position around the AI quickly)
    • How do I adjust the sprite so it no longer appears to walk in walls?
      • The AI is centered, so when walking along a wall top the feet appear to be inside the wall.
    Thank you!
     
    tonijota likes this.
  2. tonijota

    tonijota

    Joined:
    Feb 11, 2014
    Posts:
    5
    transform.rotation = Quaternion.identity in the Update() will do the trick.