How to make Enemy rotate around an object to stay between the player and the object?

I’m trying to get an enemy to stay between a player and specific object as the player moves around but I’m not sure about how to go about doing this, any help would be appreciated Thanks.

Super easy, you can just create a vector from the player to the object and use that as your target location for your enemy (either lerp to it or set it instantly).




FVector playerToObject = player.GetActorLocation() - OurObjectToProject.GetActorLocation();
playerToObject.Normalize();

// then scale that vector by how far you want your enemy to be off and set your enemy's location (or lerp towards it).