what is invalid operands 'bool' and 'bool' in operator '-'

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

i just start godot few day ago still cant solve this problem

extends KinematicBody2D

var movement = Vector2()
var movement_speed = 100

func _ready():
	set_physics_process(true)
	pass

func _physics_process(delta):
	#walkingmovement
	movement.x = Input.is_action_pressed("ui_right") - Input.is_action_pressed("ui_right")
	movement.y = Input.is_action_pressed("ui_down") - Input.is_action_pressed("ui_up")
	movement = movement.normalized()
	var motion = movement * movement_speed * delta
	move(motion)
	pass
:bust_in_silhouette: Reply From: volzhs

you can do it with int()

int(true) - int(false)

thanks worked for me

potatobanana | 2018-08-03 19:22