How do I get an object to follow my 2D player


So I need that key to trail behind and follow the player to the end Goal. I’ve tried ai follow but none of the tutorials I’ve watched seemed to work in 2d. what’s worse is when I try to set up the box trigger to the Key Blueprint there’s collision and when I try to make it “trigger only” collision the key disappears/ falls out of the level. Does anyone know how to fix this?

Hmm, well you can solve this in a variety of ways. The easiest solution is to track the players movement and create a spline that follows the player. Using this spline you can force the item or key to follow the player smoothly. Using AI for such a thing isn’t really worth it as the cost can be heavier than. You can consider using constraints, damping and physics as well, which could result in a pretty cool solution as well.

2 Likes

Hey there @TheZeroest! Welcome to the community! Depending on how you want the key to move and if you want it to follow the player. AI is definitely overkill for it unless you want the key to come off the player and move on it’s own at any point. Are there going to be many keys? Or is it only one at a time? I agree with Elias in the having a spline and following it or just having the key move towards the position of “behind the player” at all times, but it’d be easier but less visually stimulating.

1 Like