Download

Dragging rigidbody on the floor

Hi!
I’ve searched the forum for a tutorial or a suggestion on how to achieve this effect in C++ (only found blueprint version). I want to be able to drag a “dead body” on the floor while pressing and holding a key (similar to hitman or other stealthy games after you’ve knocked out an enemy). It would be nice to also be able to adjust the movement speed while dragging the body. (if it’s heavy -> reduce movement speed)

Can someone help me with this feature in C++ ?

Did no one try that out in C++ ? :frowning:

@IceDealer - It sounds like you basically just need to create a PhysicsHandle in C++ and attach it to the right actors. I’d take a look at the PhysicsHandle tutorial in the Community Tools & Content forum.

I know it’s BP, but generally speaking you can simply figure out what C++ functions correspond to a given BP node (or call that node yourself) and translate it over that way. As for creating the PhysicsHandle, take a look at Unity Developer’s Guide to Unreal for some pointers on how to spawn stuff in C++ and whatnot (if you need it, that is).

Thanks a lot! I made the blueprint version and I’m now trying to figure out the C++ approach :). Is it common practice to attach the PhysicsHandle to a socket on a bone ? So I can better change the position of the object in the hand once its grabbed.