Make projectile move actor (like a stake gun)?

So I’ve made a projectile actor that will stick to enemies when hit. Using LineTraceForObjects and AttachToComponent I can attach the projectile to the correct bone and all that.

Now, if the enemy is dead, ie it goes ragdoll/sim physics, I’m attempting to use a physics handle to grab the actor and drag it with the projectile. First problem is that to attach the projectile actor to the enemy actor, I need to use “stop movement immediately”, or it will not work very well.

This translates into the situation whereby I’ve managed to grab the enemy actor with the physics handle, but obviously it will not move. I’ve tested out some set target location and rotation functionality with the physics handle, but it’s not giving me any decent results, even with interp speed.

Was hoping anyone had a clue on how to get this working? Is there any way to make the projectile start moving again, after it has attached to the actor for example?

I’ve tried to get velocity before hitting and set velocity after but that does not produce any decent results. Also not sure how I can make the projectile stick to the wall again if I use the physics handle to move the dead enemy.

Slight update: Came to realize that I don’t really need the projectile to attach to the body if the enemy is dead. As the enemy will attach itself to the projectile instead.

Provided I could get it moving. I don’t think adding movement to the physics handle is the way to go. Simply a bypass for stopping movement by checking if the enemy is dead seems to work fine (already have that setup on enemy death as well), but I still can’t get it to move with the projectile. I am grabbing a set bone on the mesh, and while it works fine as for the grabbing part, it doesn’t want to move with the projectile as it carries on. And I can’t grab the root component it seems…

Edit: I was able to modify the enemy chars movement by attaching the root component of the enemy to the projectile. But it doesn’t work when it’s dead/sim physics…

Got it. I had to set the location of the physics handle, not the actor… Doh.

Still a bit spotty as it doesn’t seem to fire the script sometimes but when it does, it works perfectly.