Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- func _process(delta):
- if Input.is_action_pressed("ui_up"):
- if Input.is_action_pressed("ui_right"):
- rot_y = rotation.y - PI/4
- elif Input.is_action_pressed("ui_left"):
- rot_y = rotation.y + PI/4
- else:
- rot_y = rotation.y
- elif Input.is_action_pressed("ui_down"):
- if Input.is_action_pressed("ui_right"):
- rot_y = (rotation.y - PI/4) - PI/2
- elif Input.is_action_pressed("ui_left"):
- rot_y = (rotation.y + PI/4) + PI/2
- else:
- rot_y = rotation.y - PI
- elif Input.is_action_pressed("ui_right"):
- if Input.is_action_pressed("ui_up"):
- rot_y = rotation.y - PI/4
- elif Input.is_action_pressed("ui_down"):
- rot_y = (rotation.y - PI/4) - PI/2
- else:
- rot_y = rotation.y - PI/2
- elif Input.is_action_pressed("ui_left"):
- if Input.is_action_pressed("ui_up"):
- rot_y = rotation.y + PI/4
- elif Input.is_action_pressed("ui_down"):
- rot_y = (rotation.y + PI/4) + PI/2
- else:
- rot_y = rotation.y + PI/2
Add Comment
Please, Sign In to add comment