The pathfinding does a lot of calculations to determine the shortest path the object should move on and avoid obstacles. Especially for a long distance, the calculations take more time to find the path.
So it’s more resources heavy than using a force that only pushes the enemy towards the player in a straight line.
Try setting a timer to call the action Move enemy to player every like 0.25-1 seconds, instead of calling it on every frame.
Also can you explain more what you mean by smooth movement? And do you have obstacles the enemy should avoid while following the player?
a smooth movement i mean that how much speed between closer (low speed) or far (high speed) from the player there’s no obstacles it’s like a ghost chases to the player and ty i will try using a timer
You’ve got an unconditional pathfinding Move statement in your first screen shot. Pathfinding uses a fair bit of processing time, so to do that every single frame will take it’s toll.
Instead you could use a timer to reduce the number of Move actions being performed, from every game frame (~60 times a second) to a few times per second by using 0.5 or 0.25 as the timer limits.