- Home /
Enemy is not moving to player with A* pathfinding
I have my player moving perfectly the way I want to but I must be missing some component on my enemy. My enemy is not a seeker like the player and the script for the enemy movement is basic movement. Do I have to have both the enemy and the player to have A* pathfinding scripts or is there another way to solve it?
the only code that matters for now is: Enemy.transform.Translate(new Vector3(1.0f,0,0));
When using A*, the most sensible approach is often allowing only a few seeking agents to request a path in a given interval of time, because pathfinding can be an expensive operation. This might involve a queuing or priority system.
While you're still getting everything working, I wouldn't worry about that. Without robust features like path sharing, each agent who wants a path must request its own path calculation.
I'm assu$$anonymous$$g that, yes, the seeker component is required for each agent.
Answer by Linus · Nov 06, 2014 at 01:52 PM
I assume you are using A* Pathfinding Project
Everyone who are going to use pathfinding needs a seeker component. And a script that actually moves it along the path. Like the sample script provided named AIPath The sample script works with CharacterController or Rigidbody. It even falls back to moving the transform directly if it does not have either.
I recommend following this guide http://arongranberg.com/astar/docs/getstarted.php
Your answer
![](https://koobas.hobune.stream/wayback/20220613170832im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Player Dies when Collide with enemy 2 Answers
Making enemy push player 1 Answer
Need help with AI in multiplayer 1 Answer
How To Make Enemy Chase You? 1 Answer
[BUG?] Game freezes or I get error. C# 3 Answers