So what I’m trying to do is set up tall grass exactly how it’s handled in Wind Waker; if the player walks into it, it gets pushed over, and when the player is no longer near it, it goes back to being upright. The problem is, I have no idea where to start with this. Do I use triggers and adjust the grass’s angle accordingly if the player is in the trigger, or what? I can’t exactly use non-trigger colliders because then the player wouldn’t be able to walk through the grass.
Triggers/Colliders would work but would be an expensive solution, since you’d be running a physics simulation on each blade of grass.
When I did this on a previous project we modifed the Unity grass shader (called Nature/DoubleSidedWave or something similar) to include a vertex deformation that pushed the top vertices of each grass plane mesh away from the location of the player, which was supplied as a worldspace Vector3 parameter to the shader. Simple and fast because it runs entirely on the GPU, and it looks quite effective especially if you run through densely-planted patches.
Hi, i made a grass shader with lots of features like player interaction or placing the grass only on a certain height. If you are interested you can download it here: Best free Unity Grass Shader you will find! - YouTube