- Home /
Terrain that compresses when player walks over it
Hi - I was wondering if anyone could give me any pointers on the best way to create the effect that when the player moves over the terrain, it deforms or compresses.
Should I create a plane in Blender and apply animations to different areas of the terrain, and call these animations in Unity when the player is close to them?
I just thought I'd ask if this was the best way of going about it, as I'm still quite a noob (and slow) at unity.
Best, Laurien
That's actually quite a complex thing to do, do you need a complete permanence or just interested in rendering a trail for a few seconds?
You might find something useful in here:
Seconding the complex notion. Esp. if anything else is on the terrain. When the ground flexes back, things might drop through it.
Often easier to sink the player down a bit (feet sinking into the ground,) and other visual tricks for a "she's really doing a number on that ground" look.
Thanks for all your ideas - I'm just going through all these options now!
No - I don't want complete permanence, a trail for a few seconds would be ideal.
I think it wouldn't be a problem with objects falling through the terrain, as I wouldn't have anything over where the ground is defor$$anonymous$$g, and I could put a collider over the top of the terrain? The player is only able to follow set paths, so I would only apply animations to these paths so the other objects in the scene aren't affected?
I don't think rendering a trail would work, as I want the ground to look like it's physically defor$$anonymous$$g when the player is near, not simply that the player is unusually heavy and is sinking into the ground. (the player won't appear to be actually touching the terrain)
Answer by _Seph · Feb 23, 2015 at 01:50 PM
You can just write to the terrain height map directly with TerrainData.SetHeights, you might want to keep the original heightmap data so that you can bounce the terrain back up (otherwise the player can keep walking until it all is down).
But to prevent everything looking very rough you are going to end up with a very high detail terrain mesh in a small area. A better way would be to represent the result with shaders by writing a series of decals to the normal map with techniques explained here.
Your answer
![](https://koobas.hobune.stream/wayback/20220613184118im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
creating a disolvable ik rig in blender for unity3D mecanim 0 Answers
Unity Partially Ignoring Blender Animation 1 Answer
Animation for rigged chest in blender does not work in Unity 0 Answers
importing destructible object from blender 0 Answers
Unity Rotation In Animation Goes In Opposite Direction 2 Answers