Converting a PackedByteArray into a PackedFloat32Array

Hello!

I am trying to put image data onto a heightmap my reading the data of the image and then putting said data into the mesh_data of the HeightmapShape3D

Issue is that the data read from the image is a PackedByteArray and the heightmap expects a PackedFloat32Array

Is there any way to convert these?

Use PackedByteArray.to_float32_array()

1 Like

Oh!
I could have thought of trying that, haha!

God, I love Godot for just having things like that!

1 Like