Just started learning again, trying to have an object move towards a player on pick up

I’m just learning right now, essentially prototyping and trying things out to learn the basics. I’ve created an item that can be picked up and appears on the player. Now I want that item to slowly float towards the player upon pick up.

When I use move component to, it references relative location which requires fiddling with vectors and maybe vinterptop which is math/logic I don’t quite understand. I tried this based on another topic and while the objects moves to the player- it basically snaps to the position rather than tween it’s way there.

I have a timeline setup with a float track, I have no idea how it works but when I extend the duration, the object moves with the player rather than float to the player than disappear. I want the timeline to affect the action of moving initially from it’s original position, not to set the location and continue to move with the player. I’m clearly approaching this the wrong way. Here is a snippet of my essentially broken logic:

Any guidance or good starting points are appreciated. I’m so overwhelmed by all of this but I’ll be damned if I don’t make something, making games has always felt like a pipedream.

1 Like

When you use a TL, you have to calculate the start and end points of the lerp, before starting the TL. You’re sampling the actor location during the TL, hence the strange movement.

Another thing you can do is, destroy the item and replace it with a component in the player with the same mesh. Then you can use ‘move component to’

1 Like

I appreciate the tip! I was able to get it working using the replace method you described, and then the players origin location is set to 0 0 0. Thanks a ton

1 Like

Great :sunglasses:

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.