Advertisement
salahzar

script movimento casetta albero

Feb 20th, 2019
303
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.55 KB | None | 0 0
  1. extends KinematicBody
  2.  
  3. func _physics_process(delta):
  4.    
  5.     var move = Vector3()
  6.    
  7.     # movimento sinistra destra
  8.     if Input.is_action_pressed("ui_left"):
  9.         move.x = -1
  10.        
  11.     if Input.is_action_pressed("ui_right"):
  12.         move.x = 1
  13.  
  14.     # movimento aventi indietro asse z
  15.     if Input.is_action_pressed("ui_down"):
  16.         move.z = 1
  17.        
  18.     if Input.is_action_pressed("ui_up"):
  19.         move.z = -1
  20.  
  21.     # movimento alto/basso
  22.     if Input.is_action_pressed("ui_page_up"):
  23.         move.y = 1
  24.        
  25.     if Input.is_action_pressed("ui_page_down"):
  26.         move.y = -1
  27.        
  28.        
  29.        
  30.     move_and_slide(move)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement