Why is move_and_slide not available in my version?

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

I downloaded the Godot 64 bit Standard version for Linux here.

The proceeded to follow a YouTube video “Godot 3.1: Creating a Simple 3D Game: Part 2 (Programming 101: Character Movement)” by BornCG.
Two hours into listening to Fred Rogers talking to me like a 12 year old, I cannot progress in his script.

extends Spatial

var velocity = Vector3(0,0,0)
const SPEED = 20 
func _ready():

func _physics_process(delta):
    if Input.is_action_pressed("ui_up"):
    	velocity.z = -SPEED
   if Input.is_action_pressed("ui_down"):
    	velocity.z = SPEED
    if Input.is_action_pressed("ui_left"):
    	velocity.x = -SPEED
    if Input.is_action_pressed("ui_right"):
    	velocity.x = SPEED

I cannot enter the last line and get the following message;
Error 18,1 the method “move_and_slide” isn’t declared in the current class.
Line 18 is red highlighted.

I have 36 years of programming experience, did someone forget to compile something or is BornCG coding too old and something new took it’s place??

:bust_in_silhouette: Reply From: kidscancode

move_and_slide() is a method of KinematicBody. Your script says extends Spatial.

Thanks for your help. Apparently I missed a bit where he stated the root was the KinematicBody and not spatial. The man tends to meander about, making instructions longer than need be. I might not have missed that part, if he was more direct.

Brian.Black | 2020-05-09 20:13