I have an ImageTexture variable, and am trying to get the color from it at a certain position. I found I can get the Image with:
heightmap.get_data()
and there's a function to get a pixel:
heightmap.get_data().get_pixel(64,64)
but if I try it, I get this error:
Image must be locked with 'lock()' before using get_pixel().
so I tried putting this line before get_pixel():
heightmap.get_data().lock()
but nothing changed. Do you have any idea why?