Combining manual and pathfinding movement

Hey there!
I am trying to swap between manual and pathfinding movement for my units in a strategy game. However, if I start pathfinding after I have moved my object, the position resets itself before moving.

I have attached a gif for explanation. Any ideas how to fix this?

Hi

Depends on what movement script you are using to move the agents. What I think the issue is, is that when your unit resumes pathfinding movement it will try to follow a path that was calculated before your manual movement was started. This will be especially problematic if you are using the AILerp movement script, the other ones should be able to handle it relatively well.

I am using Discourse for the forum software. It works really well. The only real complain I have about it is that it uses a huge amount of RAM and disk space (it’s all docker and ruby).

thanks for the reply! I am indeed using AILerp. Is there something I should call to ensure that a new path is calculated when I start moving again with pathfinding?

Hi

The simple way is to just disable the AILerp component when you start moving the agent manually and enable it again when you start moving it using pathfinding. That should ensure the path is cleared.

that worked! Thank you!

1 Like