I put a 'space' input for the player, this input is to shoot a projectile and he work fine when the player's moving , but when I specifically press arrow up + arrow left + space or arrow down + arrow right + space, the space input stop to work and the projectile not pops up, this happens just when I press this keys
the code below
extends Node2D
var speed = 7
var tiro = true
var up = false
var down = false
var left = false
var right = false
var proj = preload('res://Scenes/Ball.tscn')
var tick = 0
func time():
tick += 1
if tick == 30:
tick = 0
tiro = true
func _process(delta):
move()
stop()
if tiro == false:
time()
pass
func move():
if Input.is_action_pressed("ui_right"):
position.x += speed
pass
if Input.is_action_pressed("ui_left"):
position.x -= speed
pass
if Input.is_action_pressed("ui_up"):
position.y -= speed
pass
if Input.is_action_pressed("ui_down"):
position.y += speed
pass
if Input.is_action_just_pressed("ui_select") and tiro == true:
print('fire')
tiro = false
var tiro = proj.instance()
get_parent().add_child(tiro)
tiro.position = $Player_2d/ColorRect/Position2D.global_position
func stop():
if position.x <= 20:
position.x = 20
elif position.x >= 1280:
position.x = 1280
if position.y <= 0:
position.y = 0
elif position.y >= 720:
position.y = 720