Hello! I'm pretty new to Godot, but I do have some limited programming experience. I'm having an issue with the get_pixel function, as it doesn't seem to return anything other than straight black, or 0,0,0,1. After a lot of digging around, I came up with some code that looks like it should work, but obviously not. Any object or resource references are correct, and tested in other ways. Also, I'm running the official stable release version, 3.0.6 I believe
Here is the relevant code:
func _input(event):
if event.is_action_pressed("ui_lmb"):
var theimage = get_node("TextureRect").get_texture().get_data()
theimage.lock()
color = get_node("TextureRect").get_texture().get_data().get_pixel(event.position.x, event.position.y)
theimage.unlock()
edit: whoops, found my own mistake! the color line should of been
color = theimage.get_pixel(event.position.x, event.position.y)
Looks like I need to get more sleep before giving up next time