Well, i want my shader to be applied to just the player that is not the leader of the group, so that way, the player you are not controlling is on B&W color. But it just applies to both players and i don't know what im doing wrong :/
I have a Player class with the node tree shown in the screenshot and this code in the _process() function:
func _process(delta):
# DEBUG
var leader = MainScene.current_player
if !self.is_leader:
debug.text = " --- DEBUG ---\n" + "leader: " + str(self.player_name) + "\n" + "team: " + str(self.team) +" \n" + "can_team: " + str(self.can_team) +" \n" + "distance: " + str(round(self.global_position.distance_to(leader.global_position))) + " <= " + str(distance_between) + " : " + str(self.global_position.distance_to(leader.global_position) <= distance_between)
animacion.material.set_shader_parameter("saturation", 0)
else:
animacion.material.set_shader_parameter("saturation", 1)
debug.text = " --- DEBUG ---\n" + "leader: " + str(leader.player_name) + "\n" + "team: " + str(leader.team) +" \n" + "can_team: " + str(leader.can_team) +" \n" + "distance: " + str(round(MainScene.other_player.global_position.distance_to(leader.global_position))) + " <= " + str(distance_between) + " : " + str(MainScene.other_player.global_position.distance_to(leader.global_position) <= distance_between)
The shader is working fine, its this one i found on Internet:
https://godotshaders.com/shader/color-manipulator/
