Dear Aaron,
first i want to say great work and thank you very much for sharing this with the community.
However one thing missing for this great looking asset is the ability to react to a player passing through it.
I searched the web for information on how this could be achieved and finally stumbled upon a solution way back from 2014.
As with many things, like volumetric lighting for example, I don’t get why epic hasn’t built in these things by now. (Luckily there is nvidia volumetric branch, which I am using right now, still I hope they would just bring it over to the main engine as I don’t know how to merge branches and fear I will be stuck with 4.15 forever if I want that volumetric light )
Anyway, back to topic: I managed to add the grass bending to your super grass and I now want to share this with you and anyone here using your grass =)
For this to work we will need to make a few additions to the parameter collection of each supergrass that should support this.
For example i will modify “supergrass5” to enable bending (you can repeat these steps with all 5 supergrasses to enable it on all of them).
Open up the material parameter collection for supergrass5: AWSpecial_MPC5N
Add 4 scalar parameters:
Name: EnablePlayerBending
Default: 0
Name: PlayerSize
Default: 60
Name: BendStrengthXY
Default: 256
Name: BendStrengthZ
Default: -256
Additionally add one Vector Parameter:
Name: PlayerPosition
Default: 1,1,1,1
Next we need to edit “Advanced-Grass-Blueprint-Preset-5” (under functions and some more folders ^^)
Add the following section to the blueprint:
I put it below Aaron’s stuff right under the WPO Output.
Now you have to connect it to Aaron’s outputs like shown here:
As you can see it uses the paramaters we added to the collection.
To be frank I don’t get the whole math behind it, this blueprint is, as mentioned before, not designed by me but found on the unreal forums in a 2014 post.
Anyway, a last step is needed to make it actually work:
In your level blueprint you have to
- enable the bending by Setting “EnablePlayerBending” to 1 in the ParamCollection in the OnBeginPlay event
- in the onTick event you have to set the PlayerPosition in the ParamCollection
(For supergrass5 this is “AWSpecial_MPC5N”)
Note that when you have added this stuff to all 5 supergrasses, you will have to enable it and update the position on all 5 parameter collections as well.
I made playersize and bendstrengths parameters so you can easily change it to fit your character’s size.
I hope you guys have fun with this little addition.