Download

Physics-Driven 6DoF?

I’m working on a proof-of-concept/prototype for a space sim game, and I’m having a really hard time implementing a physics-based 6DoF movement system for the player character. I’ve tried messing around with ‘addimpulse’ and ‘addforce’ and had some limited luck with getting a pawn to tumble in zero gravity, based on an amount of force applied to its center of mass, but that’s it. I’ve looked at the flying blueprint and a couple of standard 6DoF tutorials on YouTube, but those haven’t given me much insight into how to adapt them to use physics. I’ve seen this demonstration video posted by someone who apparently has gotten it to work, so I know it’s possible; I just can’t seem to be able to do it myself.

Has anyone had any success with creating a physics-driven 6DoF movement system, or have any pointers on how I should set one up via blueprints? I’m specifically looking for help on whether to use a pawn or a character, and what nodes (beyond the immediately obvious force applicators) to use in order to to make either one of those move in response to applied force.

Does your character have a movement or projectile component? You can add force to those.

I have done plane constrained fully physics based movement. I am assuming that you can have only one axis input at time. To get it all working simultaneously you need a bit more logic, but that is more matter of UI.

First you need some symmetrical Physics collision object (it will be used for physics only, later you make it invisible in game). You can also use your normal spaceship model, but then after any change you need to adjust center of mass, its mass etc. I think cube is best here, center it properly in 3d app, be sure it has collision in unreal.

Now add 6 thrusters: top/bottom should face forward direction. Front and rear one should either both face right or left. Left and Right one either up or down. Autoactivate them all and set their strength to 0.

For forward or back (or strafe, or up/dowen) thrust, set both sides to same value, rest should be 0.

To turn, roll, pitch set opposite thrusters to +1 and -1 times axis value. (You may need to scale those thrusters strength up by 2000 or so, this depends on mass)

You also want either some “AI” that can stop spaceship spin or movment, or simply add damping and action for stopping ship. This is also major problem because physics based forces can easily spin all out of control and its very hard to stop that just by applying forces, you need some way to automatically stop, stopping is beyond human/player skills and reaction times. There is also “pendulum effect” you will fight this all time in game, so better develop some solid solution for stopping it early.

Ps. Dot product of 2 vectors is best to check rotations (orient spaceship) in 3d space.