I wrote a c# script that remove a raycasted tree inside a terrain and I add a new tree outside the terrain gameobject.
I refresh the terrain with the following code:
float[,] heights = g_terrain.terrainData.GetHeights(0, 0, 0, 0);
g_terrain.terrainData.SetHeightsDelayLOD(0, 0, heights);
g_terrain.ApplyDelayedHeightmapModification();
When I remove the iskinematic boolean variable present in the rigidbody associated to the tree, this is shot up in the sky... it seems that the tree collider inside the terrain is already present as if the code used to update the heightmap does not work.
Any idea?
↧