make vertical aim offset bigger to accomodate for perspective
This commit is contained in:
parent
7209740950
commit
12f8bbede8
@ -10,6 +10,7 @@ const FALL_ACCELERATION: float = 25
|
||||
|
||||
@export var _respawn_height: float = -5
|
||||
@export var _controller_aim_offset: float = 20
|
||||
@export var _vertical_aim_aspect: float = 1.5
|
||||
|
||||
var aim_offset: Vector3
|
||||
var aim_input: Vector2
|
||||
@ -52,16 +53,12 @@ func _controller_aiming() -> void:
|
||||
if aim_input.length() == 0 and _move_input.length() == 0:
|
||||
return
|
||||
|
||||
var aim_direction := (
|
||||
Vector3(aim_input.x, 0, aim_input.y)
|
||||
if aim_input.length() > 0
|
||||
else Vector3(_move_input.x, 0, _move_input.y)
|
||||
)
|
||||
var input := (aim_input if aim_input.length() > 0 else _move_input).normalized()
|
||||
|
||||
var aim_direction := Vector3(input.x, 0, input.y * _vertical_aim_aspect)
|
||||
|
||||
aim_offset = (
|
||||
aim_direction.normalized().rotated(
|
||||
Vector3.UP, Referencer.main_camera.rotation.y
|
||||
)
|
||||
aim_direction.rotated(Vector3.UP, Referencer.main_camera.rotation.y)
|
||||
* _controller_aim_offset
|
||||
)
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user