I want to make the ground in this place of the terrain a bit deeper a bit lower but left shift key or right shift key and the left mouse button does not change anything on the terrain.
CodePudding user response:
I've been looking for an answer for hours, and I finally found it. If you are trying to lower a piece of land that is already at 0 height, you will not be able. You can only lower areas that are above to height 0. In short, height 0 is the minimum: you cannot go to snow values due to the way the terrain is created. To be able to make valleys then you have to select the tool "Set Hight", enter a height and raise all the ground to that height with "Flatten All", or small pieces of land by dragging the mouse on the ground. If you click "Flatten All", all the terrain will be brought to that height, losing all the changes made previously for the mountains. However, if you have already made land and you don't want to lose it and redo it from scratch, you can use the following solution:
- Export the current heightmap;
- Open the image in an editor; (I'm not an expert in Photoshop or other graphics programs, but I'm sure Photoshop has a way. If there isn't an entry in the program, find out how to use scripts in photoshop) Find a way to set the pixels according to a formula: maximum depth of valleys current value of the grayscale pixel * original height / (original height maximum depth of valleys);
- Export the image in Raw format;
- Go back to Unity and import it on the ground as you read in the link above;
- In the terrain settings set the height equal to the value you used in the formula called "roginal height" the “maximum depth of valleys” value;
- You should now have the ground as before, but higher. Set the value in the transform of the Y position equal to "-maximum depth of valleys" so that it is at the same height as before.
You should now be able to create valleys! I haven't tried the process, but I've thought about it so much I'm pretty sure it will work.
I hope you will enjoy this great work. If you think this question helps you, you can accept it, and if you want, I would be grateful if you rate this answer positively :)
Good work!