# City Tower Crane - UE5 - AGX Dynamics for Unreal

**URL:** <https://forums.unrealengine.com/t/city-tower-crane-ue5-agx-dynamics-for-unreal/581591>\
**Category:** Showcase\
**Tags:** simulate-physics, unreal-engine, UE5-0, Showcase\
**Created:** [June 14, 2022, 11:35am UTC](https://forums.unrealengine.com/t/city-tower-crane-ue5-agx-dynamics-for-unreal/581591 "2022-06-14T11:35:48Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![JosefAGX](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@JosefAGX](https://forums.unrealengine.com/u/JosefAGX)\
**Post date:** [June 14, 2022, 11:35am UTC](https://forums.unrealengine.com/t/city-tower-crane-ue5-agx-dynamics-for-unreal/581591/1 "2022-06-14T11:35:48Z")

</div>

I’m exicted to announce that [AGX Dynamics for Unreal](https://www.algoryx.se/agx-dynamics-for-unreal) is now available in Unreal Engine 5! 😀

To mark this occasion, we wanted to merge majestic with majestic: placing a 105 m (344 foot) Tower Crane in the City Sample environment created by Epic Games.

 ![TowerCraneImg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/3/c/8/3c8bc626f35b11f857a7094bb1352166b7cad745.jpeg)

[![](https://d3kjluh73b9h9o.cloudfront.net/original/4X/a/9/e/a9e2bf9da2c92246d9129840027d615fe2bfacd3.jpeg "AGX Dynamics for Unreal - UE5 - City Tower Crane") ](https://www.youtube.com/watch?v=VjTgQF0SXco)

The physics driving the Tower Crane, Wires and Concrete weight is Algoryx’s AGX Dynamics, available through the AGX Dynamics for Unreal plugin.  
It brings engineering grade physic to Unreal Engine.  
The Tower Crane can be controlled by keyboard inputs.

Now you too can try it out. In this post, I’ll go over each step necessary to set everything up.

First, there are some prerequisites:

1. Download and install [Unreal Engine 5](https://www.unrealengine.com/en-US/unreal-engine-5).
2. Download and install [AGX Dynamics for Unreal](https://www.unrealengine.com/marketplace/en-US/product/agx-dynamics-for-unreal) from the Epic Games Marketplace.
3. Get your free evaluation license [here](https://www.algoryx.se/agx-dynamics-for-unreal/).
4. Download the [City Sample](https://www.unrealengine.com/marketplace/en-US/product/city-sample) project.
5. Download the [Tower Crane Assets zip-file](https://drive.google.com/file/d/1A7saBaMN6pmFcRJGEiowfavwnGX3Vxej/view?usp=sharing) and unzip it.

Now, you should have all major parts that are needed. The final steps are to put it all together:

1. Copy everything from the `Content` directory of the unzipped zip-file from step 5 above to the `Content` directory of the City Sample project. Do the same for the `Config` directory.
2. Start the City Sample project.
3. Activate AGX Dynamics for Unreal. This is achieved by selecting (in the Unreal Editor) `Edit > Plugins` and under the `Physics` category, find and activate the AGX Dynamics for Unreal plugin.
4. Activate the AGX Dynamics for Unreal plugin using your trial license. Instructions are available in the email that you received together with the license.
5. Open the Small\_City\_LVL map that is included in the project.
6. Setup keyboard inputs. Select `Edit > Project Settings` and under `Engine`, find the `Input` item.  
 ![Input](https://d3kjluh73b9h9o.cloudfront.net/original/4X/6/c/c/6cca95592984a32bee0a40069f2cfd7c5cca08bf.png)  
Select `Import` and browse to the `TowerCraneInput.ini` file located in the `CitySample/Config` directory. You should now have the following Axis Mappings:  
 ![KeyboardInputs](https://d3kjluh73b9h9o.cloudfront.net/original/4X/9/8/6/98630a57d736d86418fdd2c3b04171345f1ae006.png)
7. Select the BP\_TowerCrane\_GameMode.  
 ![GameMode](https://d3kjluh73b9h9o.cloudfront.net/original/4X/f/e/1/fe18a7e50c7615b6b91ab16806d9bd749aa5fef6.jpeg)  
A thing to note here is that now also the `Game State` has been changed (to `GameStateBase`). By default, there is a Blueprint instance in the World Outliner called `BP_Nightmode`. This Blueprint will assume the `Game State` is the `CitySampleGameState` and it will try to bind some events to it. This will cause a runtime error since we now use the `Game State` `GameStateBase`. This can simply be fixed by not calling the `Bind Event` nodes in the `BP_Nightmode` Blueprint and just route past those as shown in the image below.  
 ![Blueprint](https://d3kjluh73b9h9o.cloudfront.net/original/4X/f/5/a/f5a8c359a11bd26f0d0896126130d75cec636569.png)

At this point, the project should be completely set up. From the Content browser, drag the BP\_TowerCrane into the World. It is located in `Content/TowerCrane/Models/TowerCrane/Blueprint`.  
Also, one or several concrete weights `BP_ConcreteWeight` can be added from `Content/TowerCrane/Models/Weight/Blueprint`.

**Interacting with other objects**  
In order to make the Tower Crane, crane hook or concrete weight interact with other objects of the environment, AGX Dynamics must be made aware of their presence.  
A static collision geometry can be obtained by adding an `AGX Trimesh Shape Component` as a child to any `Static Mesh Component` or `Instanced Static Mesh Component`.

![Trimesh](https://d3kjluh73b9h9o.cloudfront.net/original/4X/9/8/0/980dc8d742c330036814e6217927afc84c1b9da1.png)

When pressing Play, the triangle information of the `Static Mesh Component` will be read and a collision shape will be automatically created for it.

Similarly, some objects can also be made into Rigid Bodies, such that they will move when affected by external forces (and fall under gravity).  
This can be done by creating an `AGX Rigid Body Component` as a child to a `Static Mesh Component`. Then, create an `AGX Trimesh Shape Component` as a child to the `AGX Rigid Body Component` as shown in the image below.

 ![RigidBody](https://d3kjluh73b9h9o.cloudfront.net/original/4X/a/b/8/ab805599f2eaa58adb5214cca5c44c9239fb8f27.jpeg)

Note that the `Static Mesh Component` has to be set to `Movable`, and the `AGX Rigid Body Component` must have its transform target set to `Root`.  
Many of the Meshes in the City Sample environment are set to `Static` in their parent Blueprint, and others actually comprise several objects in the world, thus not making great candidates for physics simulations.  
It is however possible to create new Rigid Bodies with either primitive shapes or other `Static Mesh Components` and add those to the World. More information on how to use AGX Dynamics for Unreal is avaiable in the [User Manual](https://us.download.algoryx.se/AGXUnreal/documentation/current/index.html).
