Attach Actor to Moving object

Hello,
I spawn an actor (RedCube here) in a surface moving left and right. How can the cube attach to moving object and “follow” it? Moving object is an actor using a timeline for moving.
Cubes are actors and spawning from keyboard.

336007-1.png

336008-2.png

1 Like

You can use the node AttachActortoActor in the blueprints.
So When you spawn the red cube, get a reference to it and attach it to the target object.

I already tried it and it 's not working. Movable variable is a public variable and I set it in default as the Movable BP in world.
I also tried to connect the Parent Actor as the Hit actor of the line trace( it recognises that hit actor is the movable it just cant attach to it)