Well, you have to use global positions (get_global_pos()
), not local.
As for looking at, there is sample "look at" project in your godot instalation :) Just run it from Project list, its very simple piece of code, arrows are pointing at cursor. Maybe you will have to add or substract PI/2 or PI/4, becouse arrows in that sample project are "heading down", "y is front" (or idk how to say it..) and i am pretty sure head of your character isnt :) You will see, feel free to ask another question ;)
And, last thing, you have to add VisibilityNotifier2D on your secret location (but beware known bug #1269) connect to enter_screen
and exit_screen
signals (events) to start your look at procedure. You can add_to_group
them in "secrets" group, find them get_tree().get_nodes_in_group("secrets")
and connect with simple foreach statement (see tutorial)
edit: get_global_position()
is of course get_global_pos()