Hi, i am trying to move two objects at the same time while hold a key and press up or down but not work well, here is the code:
if Input.is_action_just_pressed("ui_page_up"):
if Input.is_action_pressed("ui_up"):
#stop the player
mover=false
#move the player and object
obj.transform.origin.x+=6
self.transform.origin.x+=6
if Input.is_action_pressed("ui_down"):
#stop the player
mover=false
#move the player and object
obj.transform.origin.x-=6
self.transform.origin.x-=6
elif Input.is_action_just_released("ui_page_up"):
#normal movement
mover=true