How to make an actor have a set distance from the player

I am making a hack and slash game that has a second controllable character (think Astral Chain), and i am trying to make it so this second character has a max distance it can be from the player. So if it tries to go too far it will stop moving.

I currently have a large capsule (18 radius) attached to the main player, hoping that i can somehow use that as a reference for where the max distance can be.

Use a Get Distance To node. It takes two actors and returns the distance between the two. If the distance is larger than your threshold, do the logic you need from this bool.