i am trying to use Behavior Graph with 2D sprite. i create an object with sprite renderer and try to move to a waypoint with patrol. the object moves along with x axis only and it is also rotated 90 degrees. i dont have any script. i believe that patrol script rotates the object. i have no idea on why this happens. can anyone help on this?
thanks,
I suggest you create a new Action script, Patrol2D copy of Patrol and go to modify its behavior, in particular there is a line of code that rotates the agent : line 114
Agent.Value.transform.forward = toDestination;
Or if you use NavMeshAgent it will take care of rotating in this case you have to act externally
I warn you that all the existing Behavior scripts are created specifically for 3D and therefore you have to create new ones or adapt them to your needs
Forgive my poor English
4 Likes
now it works on 2D. thanks for the solution.
2 Likes