Help, I'm just trying to make a movement script but if i try to add arguments to move_and_slide() it won't work.

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

Here’s the script:

extends CharacterBody3D

const MOUSE_SENSITIVITY: float = 0.2
const MOVE_SPEED: float = 3.4

@onready var lookPivot: Node3D = $LookPivot

func _ready():

func _input(event):
	if event is InputEventMouseMotion:
		rotate_y(deg_to_rad(-1 * event.relative.x * MOUSE_SENSITIVITY))
		lookPivot.rotate_x(deg_to_rad(event.relative.y * MOUSE_SENSITIVITY))
		lookPivot.rotation.x = clamp(lookPivot.rotation.x, deg_to_rad(-90), deg_to_rad(90))

func _physics_process(delta):
	var inputDir = get_input_direction()
func get_input_direction() -> Vector3:
	var z: float = (
		Input.get_action_strength("ui_w") - Input.get_action_strength("ui_s")
	var x: float = (
		Input.get_action_strength("ui_a") - Input.get_action_strength("ui_d")
	return Vector3(x, 0, z).normalized()

I’m running on Godot 4.0.2

:bust_in_silhouette: Reply From: jgodfrey

In Godot 4, move_and_slide() no longer take any arguments. Instead, it uses a number of node properties that can be set either in the editor or via code. See the docs here for details on the available properties.