# How to get changes from PhysX into UE4?

**URL:** <https://forums.unrealengine.com/t/how-to-get-changes-from-physx-into-ue4/386035>\
**Category:** World Creation\
**Tags:** vehicle, physx, unreal-engine, nvidia, Visual-Studio, CPP, question\
**Created:** [February 24, 2017, 9:57am UTC](https://forums.unrealengine.com/t/how-to-get-changes-from-physx-into-ue4/386035 "2017-02-24T09:57:37Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Syrill](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Syrill](https://forums.unrealengine.com/u/Syrill)\
**Post date:** [February 24, 2017, 9:57am UTC](https://forums.unrealengine.com/t/how-to-get-changes-from-physx-into-ue4/386035/1 "2017-02-24T09:57:37Z")

</div>

Hello everyone,

I am looking for a workflow on **how to bring custom changes in the PhysiX source into our game**.

We need to get some small changes in the PhysX source code done in order to solve a major bug in our project. [Via Nvidia we got access to the source code of PhysX](https://developer.nvidia.com/physx-source-github) and we already have some custom C++ classes (GameModes) within our project (however, we do whatever we can with blueprints).  
So far I found [this Tutorial from Rama](https://wiki.unrealengine.com/PhysX,_Integrating_PhysX_Code_into_Your_Project), but I could not figure out what exactly to do so far. Do we have to create a project in Visual Studio with the PhysX source code, do our changes, compile it all and then just exchange the PhysX.sln in the UE4 folder? Or is there more to it?

Background:  
We are developing a multiplayer racing game. While we can get the handling of our cars done within the engine, there is one showstopper bug. When a car is stationary and another car rams it, the stationary car behaves like a stone monument. The [reason for this seems to be known since 2014](https://forums.unrealengine.com/showthread.php?48843-Horrible-Car-Physics&p=184466&viewfull=1#post184466). But still, the [issue is not resolved yet](https://issues.unrealengine.com/issue/UE-21990) officially and, therefore, we need to do it ourselfs…

Any help (hint, link to tutorial, confirmation of my question (even a vote on the issue^^)…) would be appreciated.

Have a nice day,

Syrill

---

<div class="post-metadata">

**Author:** ![astearon](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@astearon](https://forums.unrealengine.com/u/astearon)\
**Post date:** [February 24, 2017, 10:13am UTC](https://forums.unrealengine.com/t/how-to-get-changes-from-physx-into-ue4/386035/2 "2017-02-24T10:13:31Z")

</div>

I have no idea if this helps but the car turning to stone might be the engine’s way to pause simulation for “idle” objects.

An idea about going around this is to cast rays from every vehicle and if another one is approaching to “wake the simulation up” sort of speak. You could do this by applying a force to the stationary car to wake it just before impact so the simulation has time to account for the incoming car.

---

<div class="post-metadata">

**Author:** ![Syrill](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Syrill](https://forums.unrealengine.com/u/Syrill)\
**Post date:** [February 24, 2017, 10:22am UTC](https://forums.unrealengine.com/t/how-to-get-changes-from-physx-into-ue4/386035/3 "2017-02-24T10:22:56Z")

</div>

Interesting idea, but the issue seems to be [within PhysX](https://forums.unrealengine.com/showthread.php?48843-Horrible-Car-Physics&p=184466&viewfull=1#post184466). And what we have observed during our tests, the physics simulation is on. The suspension, for example, reacts depending on the impact (e.g. bomb under the car), but the wheels stay glued to the ground.

---

<div class="post-metadata">

**Author:** ![Syrill](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Syrill](https://forums.unrealengine.com/u/Syrill)\
**Post date:** [February 24, 2017, 1:05pm UTC](https://forums.unrealengine.com/t/how-to-get-changes-from-physx-into-ue4/386035/4 "2017-02-24T13:05:30Z")

</div>

Alright, I gave it a try. See the screenshot for details, if you are interested. Sadly, it did not work.

Thus, back to the PhysX source code…

 ![127570-activatesimulationtest.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/d/5/1/d51f87157b8257ffc289a3b9e1a9d7abe13d9278.png)

---

<div class="post-metadata">

**Author:** ![goafBeer](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@goafBeer](https://forums.unrealengine.com/u/goafBeer)\
**Post date:** [March 10, 2017, 12:13pm UTC](https://forums.unrealengine.com/t/how-to-get-changes-from-physx-into-ue4/386035/5 "2017-03-10T12:13:54Z")

</div>

We finally managed to compile the PhysX source code!

- First of all, you don’t need to get the PhysX source code from nvidia, it’s included in Unreal already
- Make sure that your UE4 source folder has no spaces in the folder name ([link](https://answers.unrealengine.com/questions/570963/physx-generateprojects-uatbat-does-not-create-solu.html))
- Keep to the instructions from [this](https://wiki.unrealengine.com/PhysX_Source_Guide) tutorial and execute the batch files to generate the solution files or to build the libs
- Finally, rebuild the engine in Visual Studio

* * *

To build the changed Physx code on a **Mac** change the batch files to be executed as shell scripts and change TargetPlatforms to Mac or what platform you want to build for.

```
RunUAT.sh BuildPhysX -TargetPlatforms=Mac -SkipBuild -SkipCreateChangelist

```

Remove the option -SkipBuild for the build script to actually build and not only create the Xcode project files.
