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)

    yes I see your error. For an if statement, you want to ask it a question not do an assignment. so what you need is the equal to operator. == not =

    Chaosbat55 if right = true: <-- the error is here at the var right

    That should be:
    if right == true:
    or
    if right: