diff --git a/Player.gd b/Player.gd index 11117e8..b1eedea 100644 --- a/Player.gd +++ b/Player.gd @@ -28,20 +28,23 @@ func walk(): #print("Player walkDirection: ", walkDirection) -func jump(): - if Input.is_action_just_pressed("MoveJump"): - velocity.y = JUMP_VELOCITY +remote func jump(): + velocity.y = JUMP_VELOCITY func motion(delta): self.move_and_slide(velocity * delta, Vector3.UP) #rpc("move_and_slide", velocity, Vector3.UP) - + func _physics_process(delta): gravity() walk() - jump() motion(delta) +func _input(event): + if event.is_action_pressed("MoveJump"): + #rpc("jump") + jump() + # Called when the node enters the scene tree for the first time. func _ready(): pass # Replace with function body.