I am using Godot 4.3, it is giving me this error and when I change 0 to 0.0, the character stops moving. If I change the last parameter to an integer also it still shoots an error:
extends CharacterBody3D
var myVelocity = Vector3(0,0,0)
const SPEED = 6
func _ready() -> void:
pass # Replace with function body.
func _physics_process(delta: float) -> void:
if Input.is_action_pressed("ui_right") and Input.is_action_pressed("ui_left"):
velocity.x = 0
elif Input.is_action_pressed("ui_right"):
myVelocity.x = SPEED
elif Input.is_action_pressed("ui_left"):
myVelocity.x = -SPEED
else:
myVelocity.z = lerp(myVelocity.z,0,0.1)
if Input.is_action_pressed("ui_up") and Input.is_action_pressed("ui_down"):
velocity.z = 0
elif Input.is_action_pressed("ui_up"):
myVelocity.z = -SPEED
elif Input.is_action_pressed("ui_down"):
myVelocity.z = SPEED
else:
myVelocity.z = lerp(myVelocity.z,0,0.1)
velocity = myVelocity
move_and_slide()
0with0.0) it seems to work and the character moves fine. \$\endgroup\$1.0 - pow(0.5, delta * lerp_speed)instead of0.1as the last argument tolerp(). \$\endgroup\$