First time posting on these boards, I believe this is the appropriate place to ask such a question as it might have a few different answers. I will be covering my methods I have tried so far.
I’ve been trying to develop a system of pushing and pulling physics objects with my character (the character is very basic, based on the UE4 Default Character), initially I thought this wouldn’t be too tough, I can just form some kind of transformation attachment between the player and the object.
However the more I experimented the more issues I ran into trying to perfect the behaviour.
Welding the bodies together isn’t viable because only the physics object is simulating and if I was to weld I either remove physics from the object or I apply physics to my character preventing my use of the character.
I tried using the AddLocalWorldOffset functionality with sweeping enabled. This worked quite well but would have issues if you attempted to push an object up a ramp (maybe that’s just a edge case I can’t support).
Tried adding a force to the object based on our movement.
3.5) Attempted to override the linear velocity with my movement velocity.
I’ve now settled on the idea that maybe I should create some kind of physics constraint between my player and the object I am interacting with. I have managed to do that but I’m struggling to get the exact behaviour I want from my constraints.
I’m unsure what settings I should use on the constraint if I want it to to maintain a fixed separation while allowing angular Z rotation so it can be pushed up or down slopes.
I also noted a couple of issues with torque being applied when I pull or push, I guess I can reduce that by making the object friction-less when pushing and grabbing only.
I think I might have been over complicating things. Does any one have any ideas on appropriately tethering my character to a physics object so I can apply my movement to push/pull the physics object (while keeping its physics)?
For now I have kept with AddLocalWorldOffset with sweep disabled and teleport disabled (so it still exhibits velocity motion), I’ll have a special condition for certain edge cases. I’m still interested to hear if any one has any opinions or ideas.
Unfortunately the pushing and pulling exhibited there has the motion too limited for our game. Though I did have a proper look at what was happening in this system.
The solution I ended up going with was to make use of the experimental physical animation component.
With the physical animation in combination with physics constraints on the hands I got the behaviour along the lines of what I wanted.
Currently we’re working on some animations and the physical property configuration.
What is great about this system is that the object still retains full physics (internal and external).
Maintains physics correctly
Effects player with degree of realism
Freedom of motion (pull and push in any direction)
I would show my work but the forum prevents me from uploading gifs (either too big or a database error -_- ).
I suppose applying force should be the best way if you are interested in keeping the best physics behaviour since that is how you push an object in the real world. The force applied must however be controlled (as your body do for you in the real world) with a quite advanced control system. But that is something that is definitely implementable in UE4. I might be able to help you out on this if you are interested.