mohsenph69 / Godot-MTerrain-plugin

A GDExtension plugin which give godot the ability to produce highly optimized Terrain for Open world games
MIT License
372 stars 19 forks source link

Problem with grass physics #25

Open JonathanJonhansen opened 5 months ago

JonathanJonhansen commented 5 months ago

To update the grass we use update_dirty_chunks(), but this only changes which grass is visible and doesn't remove grass physics shapes. We have to use restart_grid() on MTerrain which works but it freezes the game until the terrain is removed and created. update_grass() could probably be used but it is not listed in the methods of the MGrass class By the way your extension is super cool!

mohsenph69 commented 5 months ago

Hello dear Thanks

You don't need to call update_dirty_chunks(), this function is for when you paint the grass, So grass can be updated, But this will call automatically, Also update_grass will be called automatically and you don't need to call that, These are some internal function.

Also if you add a CollissionShape to Grass it will automatically update its physics!

I really suggest you to watch my videos about grass on my channel!

By the way If you want to do something specific tell me what you want to achieve and I will guide you.