I not sure that's the best way, but you can try something like this:
- In the player script create a signal
- When input clicks the button emit that signal
- Connect the
area_entered signal of the altar with a function on the altar script
area_entered has a argument that is the object that collide with, in this case will be the player, connect the the signal of player with a function on the altar.
- Do whatever you want in this function.
In this case, when you press the key, the player will emit a signal and this signal will trigger the function in the altar.