Make object follow other object

Am trying to get an object to follow my player, but if the player turns around the object will be in front of the player.
Have looked at a few different answers here but they all produce the same result.

How do I get the object to follow the other object and stay behind the other object?

1 Like

Is your object moving on the ground? Or is it a flying object?

If its a Pawn mocing on ground, make use of the Navigation Mesh and call Move To Actor node (you can set a radius to limit how close the object gets to).

If it is a flying obejct, instead of immediately setting the obecjst location to the new one, try usig the Lerp node. Feed the output of the Lerp as the location for ‘Set Actor Location and Rotation’. THis will make sure the object will follow your Actor gradually. However if there is a chance that your Player might get occluded from the Object (like a 90 degree turn around a corner), you must always store the last location where you were able to see the Player and try to get there and afterwards look for the Player again (or simply use Player’s current location).

But if you map is very open and the object always has a line of sight to the player, you dont need to worry about that. I belieave using the Lerp will get what you want.

It still doesn’t work. This sucks, no matter how I arrange the nodes the object is always in the front. Here is the latest attempt.

First of all, you should get the hang of blueprint and understand how nodes work.

It seems like you are randomly arranging nodes in your example:

  1. by getting the forward vector and adding it to the player location, you are just adding one unit in said direction. You should multiply the direction times an amount to determine how far you want it to be in said direction.

2)What is up with the score, multiplying by 10 and adding to X? That would just move it in world space and have absolutely no relation to anything else.

  1. You don’t want to set the rotation of your object to the one of the object you are following. That will NOT make it look at the other object. Instead, it will only look where your character is looking.

4)Lerp node works by blending between A and B and Alpha determines if the blend should be closer to A or B.

This is how you could do it. Please, take note at how it works and what the nodes do so you learn how to use them.

Why thank you for drawing that out, it worked perfectly.
Can’t believe how far off I was. Looks like I need way more practice, look forward to it though.