more work on look and feel
This commit is contained in:
@@ -6,17 +6,25 @@ const CAM_CHANGE_SPEED = 2.0
|
||||
var MAX_CAM_HEIGHT = position.y + CHANGE_AMT_ON_SCROLL
|
||||
var MIN_CAM_HEIGHT = position.y - (CHANGE_AMT_ON_SCROLL * 2)
|
||||
|
||||
@onready var target = get_parent()
|
||||
|
||||
func _process(delta: float) -> void:
|
||||
look_at(get_parent().global_position,Vector3.UP)
|
||||
|
||||
camera_fov()
|
||||
camera_height_change(delta)
|
||||
|
||||
func camera_fov():
|
||||
var distance_to_target = global_position.distance_to(target.global_position)
|
||||
attributes.dof_blur_far_distance = distance_to_target + 15.0
|
||||
attributes.dof_blur_near_distance = distance_to_target - 3
|
||||
|
||||
func camera_height_change(delta):
|
||||
#if global_position.y == height_target:
|
||||
if Input.is_action_just_pressed("scroll_down"):
|
||||
if Input.is_action_just_pressed("scroll_up"):
|
||||
height_target = clamp(height_target - CHANGE_AMT_ON_SCROLL,MIN_CAM_HEIGHT,MAX_CAM_HEIGHT)
|
||||
|
||||
if Input.is_action_just_pressed("scroll_up"):
|
||||
if Input.is_action_just_pressed("scroll_down"):
|
||||
height_target = clamp(height_target + CHANGE_AMT_ON_SCROLL,MIN_CAM_HEIGHT,MAX_CAM_HEIGHT)
|
||||
|
||||
global_position.y = height_target
|
||||
|
||||
Reference in New Issue
Block a user