Node doesn't have a LookAt method error

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By pastryfriend3224

For this line: GetNode<Node>("Pivot").LookAt(Translation + direction, Vector3.Up);

I’m getting the following error: 'Node' does not contain a definition for 'LookAt' and no accessible extension method 'LookAt' accepting a first argument of type 'Node' could be found (are you missing a using directive or an assembly reference?)

Does anyone know how to fix this error? I had to Replace Node3D with Node. I don’t know what to replace LookAt with.

:bust_in_silhouette: Reply From: LazyBigCat

the function is called look_at
in godot 3.x you need to at least Spatial for 3d

and node2d for 2d

oh you are using C# :smiley:
then its LookAt
just replace “Node3D” with “Spatial”

edit 2:
you can also change documentation version by clicking “Read the Docs” at bottom left of the page