I made a localized physics system in Unity 5 (artificial gravity, inherited transforms, etc) and want to port it to Unreal. Running into a large wall. Video inside!

Hey guys!

I made a thing in Unity.

Two things stand out: Artificial gravity based on a trigger collider, and the fact that all the physics objects inside that volume seamlessly inherit all transforms. (Also, they don’t receive any external acceleration that the master rigidbody experiences!)

I achieved this with this hierarchy in Unity:

  • Container w/ trigger volume, no physics, just transform. A script applies 10 m/s2 of acceleration to all objects within the trigger.

    • → Physics enabled cubes
    • → Kinematic physics platform
  • Unconnected “master rigidbody”, physics enabled, arbitrary/unrelated collider for CoM purposes.

And, every physics tick, a separate script made the physics-less container copy the transform position and location of the master rigidbody, without actually being a child.

Unreal Engine 4.10 uses PhysX 3.3, the EXACT same physics engine that Unity does.

However, I have been entirely unable to recreate the effect in UE4. The issue is that the child physics object is aware of the overall motion of the container, and experiences world-coordinate-based momentum when the container moves.

In the Unity demo, the boxes inside the container are entirely unaware of the movement happening outside of their direct parent. In Unreal Engine, the physics objects act very normally, very aware of the movements occurring outside of their local coordinate space.

Basically, it all boils down to this:

Is there any way to make a PhysX object in Unreal only use relative coordinate space?

Thanks guys. Hopefully you enjoy my little tech demo in Unity, and are able to sort out my physics woes.

You’ll have to accept the fact that Unreal doesn’t want you to do this. I’ve been down the same blood-soaked road, and there are many other trauma cases sitting in self-help counseling huddles trying to recover as well.

Your best bet is to vote for these features in Unreal, but if you value your sanity, stay in Unity for now.

I was really hoping that this could be done in UE4.

If I paid your counselling expenses could you have another go at it?

UPDATE: Dunno if you’ve seen “Sea of Thieves” but it uses the UE4 engine and I tried out the closed beta this weekend and they’ve pretty much pulled it off. The ships you can crew with your online friends moved about in the world yet you can move around on board as though you’re on solid ground.

Peter L. Newton did something with this. The project was called LocalSimulation for UE4.16.2 although I can’t find any mention of it now. I still have the project if you would like me to upload?

From the projects read me…

Why

This was made to allow you to easily ignore world forces for physics simulations i.e. playing catch on a train. Imagine now you can play catch, and the simulation would respond in a way that the world isn’t moving at all. Allowing for predictable results in environment that require this behavior.

LocalSimulation

This plugin allows you to essentially create PxScene or Physic Scenes by placing an Actor called Local Simulation Volume, and adding other Static Mesh Components and soon Skeletal Mesh components within this Actor. Adding Constraints, and Forces will work as expected, but now with the additional layer of abstraction so that world simulation can be associated with a transform.

Yes please!

You can download LocalSimulation by Peter L. Newton from this location

Note that this solution was WIP and does not contain a solution for dealing with skeletal meshes.

Fortunately, I’ve found another example that does support this. More information and download link can be found here: Local Field Volume by Irakli

Hope that helps!

Nice one! Thanks, will check it out.