Why is Pivot not found?

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

I was going through a tutorial on how to make a basic 3D game, and I ran into an issue. The tutorial is Squash the Creeps (Moving the player with code — Godot Engine (stable) documentation in English) and the error says “get_node: (Node not found: ‘Pivot’ (relative to ‘/root/player’).)”. Is something wrong with my code?`extends KinematicBody

#meters per sec
export var speed = 14
#meters per sec sqrt
export var fall_acceleration = 75

var velocity = Vector3.ZERO

func _physics_process(delta):
var direction = Vector3.ZERO

if Input.is_action_pressed("move_right"):
	direction.x += 1
if Input.is_action_pressed("move_left"):
	direction.x -= 1
if Input.is_action_pressed("move_back"):
	direction.z += 1
if Input.is_action_pressed("move_forward"):
	direction.z -= 1
	
if direction != Vector3.ZERO:
	direction = direction.normalized()
	$Pivot.look_at(translation + direction, Vector3.UP)

velocity.x = direction.x * speed
velocity.z = direction.z * speed
velocity.y -= fall_acceleration * delta
velocity = move_and_slide(velocity, Vector3.UP)`

Is there a node called Pivot in the tree? And where is get_node() called?

SteveSmith | 2022-10-02 08:02