I’ve created a UPhysicsHandleComponent and called GrabComponent & ReleaseComponent depending on the state of a key pressed (up/down toggle).
If the Actor is ready to be dragged, I call SetTargetLocationAndRotation and specify
FVector Object_Location = GetActorLocation() + ( GetActorForwardVector() * flDistanceToPickupObject );
The distance to the object is FVector::Dist( Character_Location, TraceResult.ImpactPoint ) and serves to prevent the object from jumping to an undesired location when this interaction is triggered
The problem I have is, with physics obviously enabled… the only way I can get the object to move reliably is setting Location.Z to greater than 10, which is unrealistic because the object is now slightly off the ground (but it’s too heavy to be lifted right? hence the dragging).
Setting the Z value to 0.0f just tumbles the box awkwardly because physics is enabled… I don’t know if this is some weird friction setting
The other option is to use SetActorLocation / SetActorRotation instead of using a UPhysicsHandleComponent… this looks ugly and feels less realistic, I don’t want this kind of immediacy. It also means that the ability to drag objects over sloped surfaces is somewhat unachievable.
Long story short, how do I drag an Actor simulating physics along the ground using UPhysicsHandleComponent?