For the location rule, you have to select Keep Relative if you want the child to move with the parent
Hello there. I spawn a cube in a moving object and attach to it. I check if the hit actor of the line trace is the Movable variable. If yes, set the Cube 's location in the center of the movable and then attach the Cube to the Movable. I tried both AttachActorToActor and AttachActorToCompoment nothing seemed to work.
Movable variable is a public variable of our character blueprint and set it as the moving object in defaults.
Firstly, for some reason if I change the location rule to Keep Relative the location of the cube is doubling. For example if the movable has a world location like 5,10,15, the cube will spawn in 10,20,30 and wont move anyway. I set the location of the cube back to the movable just in case but still.
instead of SetActorLocation then attach, try this:
Attach first with keep relative location rule, then use SetRelativeLocation to (0,0,60)
I found the solution. Instead of AttachActorToActor , place the AttachActorToComponent and connect the StaticMesh of the Actor as the Parent. KeepWorld for every rule is working fine!