You can use the pathfinding behavior for that. Like this
https://editor.construct.net/#open=pathfinding-groups
Hi. Can you tell me how you get direct links to the example in the editor?
(/#open=pathfinding-groups)
I often give an answer to a question and I lack this skill.
Thanks for your attention.