How to make to make a node look at another node

Godot Version

4.2

Question

how do I get the rotation for a node to look at another node using their Position Vectors?

node_you_want_to_rotate.look_at(node_you_want_to_point.global_position)

or

node_you_want_to_rotate.rotation = (node_you_want_to_point.global_position - node_you_want_to_rotate.global_position).angle()

2 Likes

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.