Landscape grass update in game

Hi,

I’m trying to implement a feature to change the landscape height at runtime by changing the landscape materials’ WorldPositionOffset.

Then I realised that the procedural grass won’t update according to the new terrain height.
Is there any trick to do so?

I tried using these console commands

  1. “RemoveLandscapeXYOffsets” then 2)“grass.flushcache”

however it seems not working in game.

I want to change the height only when the landscape is outside of the player camera so the grass update can be just flushing out and respowning gradually instead of the smooth transition.
Thanks!

There’s also “Grass.FlushCachePIE” which implies it’s the runtime variant. I can confirm that one doesn’t work at runtime either. The grass will flush but re-generate the same previous result… Naturally everything is fine if you aren’t in PIE.

I already submitted a bug for Epic.

1 Like