Godot Version
4.5.1
Question
Does anybody knows, how to create collision shapes using noise textures?
4.5.1
Does anybody knows, how to create collision shapes using noise textures?
While I can’t say I have ever done that, I am curious - what are you trying to do by adding a collision shape to a noise texture?
Probably a height map shape
Thank you very much!
How to add it to my nodes? Or it’s like it’s built in another node?
It’s a collision shape, it can be added to the scene like other collision shapes: StaticBody3D → CollisionShape3D (with HeightMapShape3D resource). Then you can follow the code sample in the docs
var heightmap_texture = ResourceLoader.load("res://heightmap_image.exr")
var heightmap_image = heightmap_texture.get_image()
heightmap_image.convert(Image.FORMAT_RF)
var height_min = 0.0
var height_max = 10.0
# May need a different path
$CollisionShape.shape.update_map_data_from_image(heightmap_image, height_min, height_max)
Thank you!