+1 vote

I am trying to make "2D" terrain. I discovered that in the Editor you can make a CollisionShape with a HeightMap Shape. With OpenSimplexNoise I managed to edit the HeightMap so that it has some random elevation.

godot terrain collision

However it only applies to the CollisionShape and I don't know how I can "link" it with a Mesh so that the Mesh is the same shape as the HeightMap.

I found out that you can make a CollisionShape based on a Mesh. Is there a way to make it the other way around?

Godot version v3.4.2.stable.official [45eaa2daf]
in Engine by (16 points)

1 Answer

+2 votes
Best answer

Godot does not come with a terrain node to render heightmaps, so you have to script that.

There are several ways to go:

Final note: be aware that in a heightmap, one cell == one vertex. So if for example you need a 1x1 terrain, you actually need 2x2 cells, because a quad contains 4 vertices. So if you need a 100x100 terrain, you will need 101x101 cells, and so on. See https://github.com/godotengine/godot/issues/58933

by (29,092 points)
selected by

Thanks, this is what I was looking for!

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.