UIPF True Physics
Configuring an asset to be used with true physical interaction is simple! Here’s what you need to do:
1. The UIPF true physics system switches out foliage at runtime for a physically simulated version. Firstly to add custom physically simulated foliage to be used with UIPF you will need a Static Mesh, and a Rigged Skeletal Mesh version of that mesh with a configured Physics Asset.
There are a few important things to cover when configuring your physics asset:
A: One or more of the bones near the base/anchor point of your foliage assets need to have a Body set to Kinematic (otherwise it will just fly/fall away (pictured)
B: All bodies should have Enable Gravity Un-Checked. Theoretically gravity is cool, but in practice we only use physics to handle direct interaction as we can’t apply the same gravity to the static mesh copies.
C: All constraints should be configured with angular motors designed to return any armature to it’s zero/default position after an interaction. Pictured below is the constraint setup for constraints on one of our plants.
I highly recommend setting higher Target orientation strengths for bones closer to the anchor point. This will give you nice bendy results.
D: Don’t forget to set Angular and Linear dampening values on your Bodies too! 0.1 is a good default value, but just adjust them per plant as you see fit.
E: We’ve included a wide range of physical foliage types with UIPF intentionally, so you can easily have a look and see what settings you might like to try for plants of similar sizes to yours.
2. Once you’ve got your rigged and configured physical mesh version, all that’s left is to setup the relationship between the static and physical version. This is done via a data table. You can either create your own and assign it on the UIPFManager, or simply add to the datatable in the UIPF Content folder.
For any foliage you wish to add, simple create a new row and assign the static and skeletal meshes.
You can also choose what your foliage meshes collide with (alongside physics bodies which are interactive by default). It’s not recommend you enable collision with physical foliage as this can cause some extreme ‘popping’ when switching the physics version of the assets in.
Very important note!
Foliage (in the foliage painting/procedural tools) MUST have collision set to overlap all otherwise it won’t be replaced with physics foliage.
3. Now you’re ready to go! Simply paint your static meshes as you would with the UE4 foliage tools and they will be replaced with physics version at runtime around your character.