So I'm trying to write a script for a game and the most important part is the script needs to be able to recognize the NPC is there and then click on it. So I am using pyautogui and I give the script an image, the issue is it can only recognize the NPC if it's in the same exact angle it was in when the picture was taken. Here is a code example of how I'm doing it and I hope someone has a better method because mine isn't working.
Code
while 1:
if pyautogui.locateOnScreen('character.png', confidence=0.8) is not None:
print("I can see it")
time.sleep(0.5)
else:
print("I cannot see the character")


