i have the error unexpected assign here my whole code
extends KinematicBody2D
const UP = Vector2(0,-1)
const GRAVITY = 20
const MAXFALLSPEED = 200
const ACCEL = 20
const MAXSPEED = 150
const JUMPFORCE = 500
var motion = Vector2()
var right = true
func _ready():
pass
func _physics_process(delta):
motion.y += GRAVITY
if motion.y > MAXFALLSPEED:
motion.y = MAXFALLSPEED
if right = true: <-- the error is here at the var right
$Sprite.scale.x = 1
else:
$Sprite.scale.x = -1
motion.x = clamp(motion.x,-MAXSPEED,MAXSPEED)
if Input.is_action_pressed("right"):
motion.x += ACCEL
right = true
elif Input.is_action_pressed("left"):
motion.x -= ACCEL
right = false
else:
motion.x = lerp(motion.x,0,0.2)
if is_on_floor():
if Input.is_action_pressed("jump"):
motion.y = -JUMPFORCE
motion = move_and_slide(motion,UP)